Show in room

Started on the old forum in September 2009 · view the original in the archive · old links redirect here

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.

9 participants
ranzit2 Developer · 187 posts #61

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 🙂

she is beautifull than php.and i love her more than php.

murshid7 Junior · 22 posts #62

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?

ranzit2 Developer · 187 posts #63

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

she is beautifull than php.and i love her more than php.

murshid7 Junior · 22 posts #64

i am also getting the mate error bro i need it as to be displayed user nick name entered the chatroom

murshid7 Junior · 22 posts #65

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."'"); } }

murshid7 Junior · 22 posts #66

here is my chat.php

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

Ponick Developer · 216 posts #67

murshid7 wrote: here is my chat.php

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

use this code in core.php

function isenta($text)
{
  $sfil[0] = "enttt";

  $text = str_replace(" ", "", $text);
  $text = strtolower($text);
  for($i=0;$i<count($sfil);$i++)
  {

    $nosf = substr_count($text,$sfil[$i]);
    if($nosf>0)
    {
      return true;
    }
  }
  
  return false;
}

and use this into chat.php after

if(isspam($text)) { $chnick = getnick_uid($chat[0]); echo "Chat system:»oi! $chnick, no spamming "; }

else if(isenta($text))
                  {
                    $chnick = getnick_uid($chat[0]);
                    echo "<font color=\"red\"><b><i>*$chnick enterd*</font></i></b></font><br/>";
                  }

demo here 🙂 just click and see

/* I don't know everything hehe */

Find me on facebook

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close