chat kick
Posted: Wed Apr 13, 2005 4:46 pm
I have developed a pretty nice PHP/Javascript chat server that works pretty good.
I'm finishing it up, by programming some administration functions.
I'm stuck on the kicking part.
I have a form that sets their status in the database to kicked or '1'
then when my hidden frame reloads itself to grab new messages (once per second) it checks to see if the users status is set to kicked... and if it is I want it to redirect them to a page named chatkick.php.
I can't use php header location because text has already been sent to the page. So I need to use javascript.
I tried this
however, if this does work, it will only reload the current frame. So I tried parent.location = ''; and that didn't work.
What command do I need to use?
I'm finishing it up, by programming some administration functions.
I'm stuck on the kicking part.
I have a form that sets their status in the database to kicked or '1'
then when my hidden frame reloads itself to grab new messages (once per second) it checks to see if the users status is set to kicked... and if it is I want it to redirect them to a page named chatkick.php.
I can't use php header location because text has already been sent to the page. So I need to use javascript.
I tried this
Code: Select all
$sarray = mysql_fetch_array(mysql_query("e;SELECT status FROM chatusers WHERE username = '"e;.$_COOKIEї'username']."e;'"e;));
if($sarrayї'status'] == "e;1"e;){ ?><script language="e;javascript"e;>document.location.href = 'http://www.showmypro.com/chatkick.php'; </script><? }What command do I need to use?