ASP Chat Box

posted by Site Editor date: Tuesday, September 19, 2006 category: ASP
  Featured Story | Printable View | Email It | Comments | Write Comment

Asp Chat Box s a free and easy to use chat application can be used in a simple website. This version of AspChatBox can read and write only a single file. If you can work on thi script, you may write a custom script for you.


Do not forget to read/write permission on chatlog.txt file

<html>
<head>
<title>ASP Chat Box</title>
<META http-equiv="refresh" content="5">
</head>
<body>


<%
if request.Form("func") = "Send" then

nickName = trim(request.Form("nickName"))
nickName = replace(nickName, "'", "''")
chatBox = trim(request.Form("chatBox"))
chatBox = replace(chatBox, "'", "''")
session("nickName") = nickName

Set objFlSys = Server.CreateObject("Scripting.FileSystemObject")
chatFile = Server.MapPath ("chatlog.txt")
Set objStreamOutput= objFlSys.OpenTextFile (chatFile, 8, 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="aspchatbox.asp" method="post" >
<strong>Nickname :</strong> <input name="nickName" value="<%=session("nickName")%>"/><br/>
<strong>Message : </strong>
<br/><textarea cols="60" rows="4" name="chatBox"></textarea>
<input type="submit" name="func" value="Send"/>
</form>

</body>
</html>


Custom Search



Gazatem Technologies Active News Manager


page counter

Listed with 411asp.net
Listed with 4aspin.com
PHP, ASP, .NET, JSP Resources, Reviews