Chat. Vil ikke skifte side
Jeg forsøger at lave en chat, men den vil ikke skifte over til chat siden efter man har indtastet et brugernavn.Kan nogen se hvad der er galt?
<% Option Explicit%>
<% Response.Buffer = true %>
<html>
<head>
<title>Surf Café login</title>
</head>
<body>
<% If trim(Request.Form("name")) = "" Then %>
<h1> Welkommen til Surf Café </h1>
<p>Indtast et brugernavn herunder og tryk på knappen.</p>
<form action="default.asp" method "POST">
<p>Dit navn: <input type="text" size="20" name="Name"></p>
<p><input type="submit" name="Submit" value="Luk mig ind!"></p>
</form>
<%
Else
Dim users, refresh
Session("name") = Request.Form("name")
If Application("NumUsers")=0 then
' Initialiser (eller gen-initialiser) bruger listen
' og samtalen
ReDim temp1(50)
ReDim temp2(50)
Application("users") = temp1
Application("refresh") = temp2
End If
' Hent arrays
users = Application("users")
refresh = Application("refresh")
' Find en tom plads og sæt brugeren ind
Dim i
For i = 1 To 50
If users(i) = "" Then
users(i) = Session("name")
refresh(i) = time
Application.Lock
Application("NumUsers") = Application("NumUsers") + 1
Application.Unlock
Exit For
End If
Next
If i = 51 Then Response.Redirect "toomany.asp"
'Læg array tilbage i applikationsvariablerne
Application.Lock
Application("users") = users
Application("refresh") = refresh
Application.Unlock
If not IsEmpty(Application("conversation")) Then
Application.Lock
Application("conversation") = "<b><i>" & _
Session("name") & _
"Træder ind i Surf Café </b></i><br>" & _
Application("conversation")
Application.Unlock
End If
Response.Redirect "cafe.asp"
End If
%>
</body>
</html>
