lelu
01-16-2007, 08:47 PM
Hello,
I have a code for simple chat
3 windows
-one for nickname
-second for message/comments
-third where all messages/comments appears from all visitors.
no password, no sign up needed.
Question: onclick "send"button I need message appears in 3rd window and 2nd clear.
Pleease,help.
Thank you.
<html>
<head>
<title>ASP Chat Box</title>
<META http-equiv="refresh" content="">
</head>
<body>
<%
if request.Form("func") = "Send" then
nickName = trim(request.Form("nickName"))
chatBox = trim(request.Form("chatBox"))
session("nickName") = nickName
Set objFlSys = Server.CreateObject("Scripting.FileSystemObject")
chatFile = Server.MapPath ("chatlog.txt")
Set objStreamOutput= objFlSys.OpenTextFile (chatFile, 1, TRUE)
ipaddr=Request.ServerVariables("REMOTE_ADDR") & " : "
objStreamOutput.Write "<b>" & nickName & "</b>:"
objStreamOutput.WriteLine chatBox & "<BR>" & vbnewline
Set objStreamOutput = Nothing
end if
Set objFlSys = Server.CreateObject("Scripting.FileSystemObject")
chatFile = Server.MapPath ("chatlog.txt")
Set objStreamInput = objFlSys.OpenTextFile (chatFile, 1, False, False)
Response.Write objStreamInput.ReadALL & "<br/>"
Set objStreamInput=Nothing
%>
<form action="" method="post" >
<strong>Nickname :</strong>
<p>
<input name="nickName" value=""nickName")" size="18"/><br/>
</p>
<p>
<strong>Message : </strong>
<br/>
<textarea cols="14" rows="11" name="chatBox"></textarea>
<input type="submit" name="func" value="Send"/>
<textarea cols="25" rows="11" name="chatBox0"></textarea></p>
</form>
</body>
</html>
I have a code for simple chat
3 windows
-one for nickname
-second for message/comments
-third where all messages/comments appears from all visitors.
no password, no sign up needed.
Question: onclick "send"button I need message appears in 3rd window and 2nd clear.
Pleease,help.
Thank you.
<html>
<head>
<title>ASP Chat Box</title>
<META http-equiv="refresh" content="">
</head>
<body>
<%
if request.Form("func") = "Send" then
nickName = trim(request.Form("nickName"))
chatBox = trim(request.Form("chatBox"))
session("nickName") = nickName
Set objFlSys = Server.CreateObject("Scripting.FileSystemObject")
chatFile = Server.MapPath ("chatlog.txt")
Set objStreamOutput= objFlSys.OpenTextFile (chatFile, 1, TRUE)
ipaddr=Request.ServerVariables("REMOTE_ADDR") & " : "
objStreamOutput.Write "<b>" & nickName & "</b>:"
objStreamOutput.WriteLine chatBox & "<BR>" & vbnewline
Set objStreamOutput = Nothing
end if
Set objFlSys = Server.CreateObject("Scripting.FileSystemObject")
chatFile = Server.MapPath ("chatlog.txt")
Set objStreamInput = objFlSys.OpenTextFile (chatFile, 1, False, False)
Response.Write objStreamInput.ReadALL & "<br/>"
Set objStreamInput=Nothing
%>
<form action="" method="post" >
<strong>Nickname :</strong>
<p>
<input name="nickName" value=""nickName")" size="18"/><br/>
</p>
<p>
<strong>Message : </strong>
<br/>
<textarea cols="14" rows="11" name="chatBox"></textarea>
<input type="submit" name="func" value="Send"/>
<textarea cols="25" rows="11" name="chatBox0"></textarea></p>
</form>
</body>
</html>