hi all.. i an making a chat room in asp..
i have got a problem with using applications. For some reasion they r not doing what i think they would.. its like they are not retaining there value. I have done it with a text file as a temp thing to see if the rest of my code is working, and now that it is i need to change it back to using applications.
the code is:
<%
set fs=server.createobject("scripting.filesystemobject"
set ts=fs.opentextfile (server.mappath ("db/number.txt"
,1,true)
do until ts.atendofstream
i = ts.readline
Loop
If Request("BUTTON"
="Submit" and i <= 5 Then
Application("comments"
=Application("comments"
& "<P>" & Request("comments"
i = i+1
Application("comments"& i)=Request("comments"
set ts=fs.opentextfile (server.mappath ("db/number.txt"
,2,true)
ts.writeline i
Else If Request("BUTTON"
="Submit" and i > 5 Then
Application("comments0"
=Application("comments1"
Application("comments1"
=Application("comments2"
Application("comments2"
=Application("comments3"
Application("comments3"
=Application("comments4"
Application("comments4"
=Application("comments5"
Application("comments5"
=Application("comments6"
Application("comments6"
=Request("comments"
Application("comments"
=Application("comments0"
& "<p>" & Application("comments1"
& "<p>" & Application("comments2"
& "<p>" & Application("comments3"
& "<p>" & Application("comments4"
& "<p>" & Application("comments5"
& "<p>" & Request("comments"
End If
End If
%>
Please.. how could i get applications to work???
i have got a problem with using applications. For some reasion they r not doing what i think they would.. its like they are not retaining there value. I have done it with a text file as a temp thing to see if the rest of my code is working, and now that it is i need to change it back to using applications.
the code is:
<%
set fs=server.createobject("scripting.filesystemobject"
set ts=fs.opentextfile (server.mappath ("db/number.txt"
do until ts.atendofstream
i = ts.readline
Loop
If Request("BUTTON"
Application("comments"
i = i+1
Application("comments"& i)=Request("comments"
set ts=fs.opentextfile (server.mappath ("db/number.txt"
ts.writeline i
Else If Request("BUTTON"
Application("comments0"
Application("comments1"
Application("comments2"
Application("comments3"
Application("comments4"
Application("comments5"
Application("comments6"
Application("comments"
End If
End If
%>
Please.. how could i get applications to work???