Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old August 16th, 2004, 12:41 PM
mtarby mtarby is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 180 mtarby User rank is Private First Class (20 - 50 Reputation Level)mtarby User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 15 h 41 m 43 sec
Reputation Power: 6
Help clearing chat contents

I'm trying to modify a chat script I came across. I want the contents to clear when someone exits the chat, but can't get it to work.

Here's what was included to clear the contents

Code:
  <%
  application("emchatusers") = ""
  for f=1 to 20
  Application(f)=""
  next
  %>


This is the code from the main chat page - would adding a line to kill the cookie help me?

Code:
  <%
  if request("event")="login" then 
 if (InStr(application("emchatusers"), ","& request("login") &",")<>0) then response.redirect("default.asp?error=1&username=" & request("login"))
  Response.Cookies("emchatlogin")=request("login")
  application("emchatusers") = application("emchatusers") & request("login") &"," & minute(now) & ","
  
  Application(20)=Application(19)
  Application(19)=Application(18)
  Application(18)=Application(17)
  Application(17)=Application(16)
  Application(16)=Application(15)
  Application(15)=Application(14)
  Application(14)=Application(13)
  Application(13)=Application(12)
  Application(12)=Application(11)
  Application(11)=Application(10)
  Application(10)=Application(9)
  Application(9)=Application(8)
  Application(8)=Application(7)
  Application(7)=Application(6)
  Application(6)=Application(5)
  Application(5)=Application(4)
  Application(4)=Application(3)
  Application(3)=Application(2)
  Application(2)=Application(1)
  
 Application("1")="<font color='green'><b>"& request.Cookies("emchatlogin") & "</b> enters chatroom</font>"
  Response.Redirect "chat.asp"
  end if
  
  if request.Cookies("emchatlogin")="" then Response.Redirect"default.asp"
  if mid(request.Cookies("emchatlogin"),1,1)=" " then Response.Redirect"default.asp"
  
  
  if request("event")="post" then 
  
  Application(20)=Application(19)
  Application(19)=Application(18)
  Application(18)=Application(17)
  Application(17)=Application(16)
  Application(16)=Application(15)
  Application(15)=Application(14)
  Application(14)=Application(13)
  Application(13)=Application(12)
  Application(12)=Application(11)
  Application(11)=Application(10)
  Application(10)=Application(9)
  Application(9)=Application(8)
  Application(8)=Application(7)
  Application(7)=Application(6)
  Application(6)=Application(5)
  Application(5)=Application(4)
  Application(4)=Application(3)
  Application(3)=Application(2)
  Application(2)=Application(1)
  
  Application("1")="<b>" & request.Cookies("emchatlogin") & ":</b>"& request("text")
  Response.Redirect "chat.asp?event=form"
  end if
  
  if request("event")="logout" then 
  Application(20)=Application(19)
  Application(19)=Application(18)
  Application(18)=Application(17)
  Application(17)=Application(16)
  Application(16)=Application(15)
  Application(15)=Application(14)
  Application(14)=Application(13)
  Application(13)=Application(12)
  Application(12)=Application(11)
  Application(11)=Application(10)
  Application(10)=Application(9)
  Application(9)=Application(8)
  Application(8)=Application(7)
  Application(7)=Application(6)
  Application(6)=Application(5)
  Application(5)=Application(4)
  Application(4)=Application(3)
  Application(3)=Application(2)
  Application(2)=Application(1)
  
 Application("1")="<font color='green'><b>"& request.Cookies("emchatlogin") & "</b> leaves chatroom</font>"
  
  
  userarray=split(application("emchatusers"),",")
  userscount=int(((UBound(userarray)+1))-0.5)
  for f = 0 to  userscount-1 step 2
  if userarray(f)=request.Cookies("emchatlogin") then
  reptmp=userarray(f) & "," & userarray(f+1) &","
  application("emchatusers") = replace(application("emchatusers"),reptmp,"")
  end if
  next
  
  Response.Cookies("emchatlogin")=""
  Response.Redirect"default.asp"
  
  end if
  
  if request("event")="form" then 
  %>
  


Any suggestions would be appreciated!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Help clearing chat contents


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT