< '************************************** ' Name: Chat program ' Description:Chat program useing arrays ' . ' By: Bhushan. ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:None ' 'Side Effects:None 'This code is copyrighted and has limite ' d warranties. 'Please see http://www.Planet-Source-Cod ' e.com/xq/ASP/txtCodeId.7821/lngWId.4/qx/ ' vb/scripts/ShowCode.htm 'for details. '************************************** 1. //chatpage.asp Chat Page name this file as chatpage.asp. here we are dividing the page into 2 frames. Next open another page and type the following code.. 2. // Display.asp <% set MyServer=Request.ServerVariables("SERVER_NAME") set MyPath=Request.ServerVariables("SCRIPT_NAME") MySelf="HTTP://"&MyServer&MyPath %> Display Page
Site hosted by Angelfire.com: Build your free website today!

<%=NOW%>

<% TempArray=Application("Talk") FOR i=0 to Application("TPlace")-1 Response.Write("

"&Temparray(i)) NEXT %> name the page as display.asp. here the message typed by the user is captured in a Application level variable. Then the message is put in an array and is written on to the browser by reading from that array variable. Next open another page and type the following code .. 3. // Message.asp <% IF not Request.Form("message")="" THEN Application.LOCK IF Application("TPlace")>4 THEN Application("TPlace")=0 END IF TempArray=Application("Talk") TempArray(Application("TPlace"))=Request.Form("message") Application("Talk")=TempArray Application("TPlace")=Application("TPlace")+1 Application.Unlock END IF %> Message Page

In this page we are creating a text field and a submit button. After typing a message if u click on submit button the message is captured in application variable which will be used by the display.asp Next open notepad and type the following code and save it as global.asa 4. ///global.asa