Chatten skal have password
Jeg er IN DEEP TROUBLE. Jeg har en mini-chat (uden error handling) hvor alle kan logge på, bare ved at skrive et brugernavn, man selv vælger. Jeg vil gerne have lavet det sådan, at man også skal skrive password før man logger på, og det skal være '1234' som fast valgt password. Nogen der vil ændre i det her script, så man skal logge på med password?<%
if session("brugernavn") = "" THEN session("brugernavn") = request("brugernavn")
if session("brugernavn") = "" Then
%>
<body bgcolor="#004080"><form action="chattest.asp">
<font face="tahoma, arial, verdana, georgia" size="2" color="#FFFFFF">
brugernavn<br><input type=text name="brugernavn"><br><br>
<input type="Submit" value="LOGIN">
</form>
<%
response.end
end if
Response.Buffer = True
Select Case LCase(Request.QueryString("mode"))
Case "chat" %>
<html>
<head><meta http-equiv="REFRESH" content="5; URL=chattest.asp?mode=chat">
<title>Chat</title>
</head><body bgcolor="#6699CC"><font face="tahoma, arial" size="2" color="#000000">
<%
strUser = "<b>" & Session("brugernavn") & "</b>: "
strMessage = Server.HTMLEncode(Trim(Request.Form("message")))
' // Her rydes Chat loggen, hvis den overstiger 10000 karakter
If Len(Application("ChatLog")) > 10000 Then
Application.Lock
Application("ChatLog") = ""
Application.UnLock
End If
If Request.Form("Action") = "Send" Then
If Len(strMessage) > 0 Then
strChatContent = strUser & strMessage & "<br>" & Application("ChatLog")
Application.Lock
Application("ChatLog") = strChatContent
Application.UnLock
End If
End If
Response.Write Application("ChatLog")
Case "send" %>
<body bgcolor="#004080">
<form method="POST" action="chattest.asp?mode=chat" target="Top">
<input type="text" name="message" size="30"> <input type="submit" name="Action" value="Send">
</form>
<% Case Else %>
<frameset rows="200,*" frameborder="0" frameborder="no" border="0" border="no">
<frame name="Top" src="chattest.asp?mode=chat" scrolling="auto" marginwidth="4" marginheight="4" noresize border="0">
<frame name="Bottom" src="chattest.asp?mode=send" scrolling="no" marginwidth="4" marginheight="4" border="0">
<noframes>
<body>
<p>Denne side bruger frames, og det understøtter din browser ikke.</p>
</body>
</noframes>
</frameset>
<% End Select %>
</body></html>
