Forums

PHP

This topic is locked

log off problem

Posted 05 May 2003 14:52:12
1
has voted
05 May 2003 14:52:12 ernst dommisse posted:
I'm working on a little chat app using flash, php and mySQL. There are just 4 slots available (i.e. max 4 people chatting). Now all works well. Whenever someone logs in, it looks for available slots and takes an empty one. However, whenever someone leaves the slot isn't freed up.

I've made a tiny SQL table with the fields slot1 through slot4. When 'bob' logs in, it browses through the fields and looks for an empty one. If slot2 is empty, slot2 gets the value 'bob'. Now, when bob leaves slot2 needs to go to an empty value again. This is no problem if people would just click a little 'log off' button... But ofcourse, people aren't going to do that. They're likely to just close the window. How then, do I get slot2 empty again when someone exits?

I presume there's some way in which I could sortof 'ping' the online users, and when there's no response within a certain timelimit the slot is freed up again. Does that seem like a reasonable approach? And how would I do that?

Hope someone can help. Thx

<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=225 HEIGHT=40><PARAM NAME=movie VALUE="www.intricate.nl/banners/360flipbanner.swf"><PARAM NAME=menu VALUE=false><PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent><PARAM NAME=bgcolor VALUE=#FFFFFF><EMBED src="www.intricate.nl/banners/360flipbanner.swf" menu=false quality=high wmode=transparent bgcolor=#FFFFFF WIDTH=225 HEIGHT=40 TYPE="application/x-shockwave-flash" PLUGINSPAGE="www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>

Reply to this topic