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.
something else wrote:
there is plenty of chat.php in on coding-talk just download another 1 🙂 ....
when you editing scripts make a test folder so if u do make a mess up and dont know how to put it back then it wont matter 🙂
does it give you an error message why its not working? :)
if i give you my chat.php and index.php .... can you recod it ? 🙁
Ponick wrote:
im goin to say this bad news again...;(it didnot show any thing 🔫
its a function in core.php that had to b modified.
///////////////////////////////////////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."'");
}
try this in core.php
and this in chat.php just after where if(!canenter($rid,$sid)) function end
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);
ranzit2 wrote:
its a function in core.php that had to b modified.
///////////////////////////////////////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."'");
}
try this in core.php
and this in chat.php just after where if(!canenter($rid,$sid)) function end
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);
it's very easy..just like my previous post..put this below if(isbanned){}
$bago = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
if($bago[0]==0)
{
$msg = "".getnick_uid($uid)." Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$rid."'");
}
kiLLeR-eyEd_14 wrote:
it's very easy..just like my previous post..put this below if(isbanned){}
$bago = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE uid='".$uid."' AND rid='".$rid."'"));
if($bago[0]==0)
{
$msg = "".getnick_uid($uid)." Enter the Room";
mysql_query("INSERT INTO ibwf_chat SET timesent='".time()."', chatter='".$uid."', msgtext='".$msg."', rid='".$rid."'");
}
it doesnt do anything 🙁 . Is there need any sql table specialy? Its be better if some one you guys kindly give me the tested those php file ....
something else wrote:
can u put this on top of the page after <?php
error_reporting (E_ALL);
ini_set ('display_errors', true);
because its not showing any errors for me and that will tell you where the error is :)
Ponick wrote:
it doesnt do anything 🙁 . Is there need any sql table specialy? Its be better if some one you guys kindly give me the tested those php file ....
it's working in my site..does your script really a lava?
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.