66 replies · 2,763 views · started 17 years ago · 1 min read
TL;DR · summary of 66 replies
- The fix was to add session handling in chat.php using $_SESSION.
- The code approach involved adding session_name("PHPSESSID"); session_start(); $enter = isset($_SESSION['enter']) ? 1 : 0; at the top of chat.php, and checking $enter == 1 for entering the room.
- It was concluded that using sessions can prevent cheating by users who try to enter without being seen.
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
murshid7 wrote:
its making me confused you said to add function in core.php already and i have done it and then it is showing as mate enter and then as ponick got the same problem and he also asked the a question about it and then you said him to paste the function to core.php what to do you mean? it is already done na? your saying a thing which as been done already i dont get it please tell me only that part.
if u had already function there del that..
the function i posted paste the part of core.php in core.php and the other part in chat.php and its working fine 4 ponick 🙂
i did like you said i pasted the part of chat.php with my chat php and i pasted the core.php into my core.php and at last when ponick said you that he got as mate enter the room you asked him to copy the core function to core.php please bro its confusing me can you post it here?
murshid7 wrote:
i did like you said i pasted the part of chat.php with my chat php and i pasted the core.php into my core.php and at last when ponick said you that he got as mate enter the room you asked him to copy the core function to core.php please bro its confusing me can you post it here?
i had said him only when he got *mate error as he was nt having the core part in core.php .4 u i m again telling that paste the core part in core and the chat part as instructed if it doesnt work pm ponick..i had no access to pc so cant post.u can take from old post
here is my core.php tell me what is wrong with this
///////////////////////////////////////Add to chat
function addtochat($uid, $rid)
{
$bago = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
if($bago[0]==0){
$msg = "*mat Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$rid."'");
}
$timeto = 120;
$timenw = time();
$timeout = $timenw - $timeto;
$exec = mysql_query("DELETE FROM ibwf_chonline WHERE lton<'".$timeout."'");
$res = mysql_query("INSERT INTO ibwf_chonline SET lton='".time()."', uid='".$uid."', rid='".$rid."'");
if(!$res)
{
mysql_query("UPDATE ibwf_chonline SET lton='".time()."', rid='".$rid."' WHERE uid='".$uid."'");
}
}
addtochat($uid, $rid);
$timeto = 300;
$timenw = time();
$timeout = $timenw-$timeto;
$deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
$nick = getnick_sid($sid);
}
and hey people i am using methos version 3 thos works with it right? cause almost it is showing mate enter room to me! but i want to make it as user nick name enter chat room
addtochat($uid, $rid);
$timeto = 300;
$timenw = time();
$timeout = $timenw-$timeto;
$deleted = mysql_query("DELETE FROM ibwf_chat WHERE timesent<".$timeout."");
$rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id='".$rid."'"));
$rname = $rooms[1];
$nick = getnick_sid($sid);
}
and hey people i am using methos version 3 thos works with it right? cause almost it is showing mate enter room to me! but i want to make it as user nick name enter chat room