Jump to content

I'm trying to make a simple chat window for a phpmotion site


brokenmech

Recommended Posts

I want to basically use the code from this tutorial http://www.tutorialized.com/view/tutorial/Simple-Chatbox-in-PHP-MySQL/23971 but instead of users entering their names I want to run the checklogin and pull the name of the user from the database.

 

 

I am having two problems with the basic tutorial code though. I am getting a notice that I have an undefined variable here...

 

$message=Smiley($message); //Smiley faces

   print "<font color='red'><b>$getmsg3[name]:</b></font> $getmsg3[message]<br>";



}



function Smiley($texttoreplace)

{

    $smilies=array( 

    

    

    '' => "<img src='images/smile.gif'>",

    ':blush' =>"<img src='images/blush.gif'>",

    ':angry' =>"<img src='images/angry.gif'>",

    ''=>     "<img src='images/shocked.gif'>",  

    '[s]fuck[/s]'=>"$#$%",

    '[s]Fuck[/s]'=>"&$#@"

  



    );



    $texttoreplace=str_replace(array_keys($smilies), array_values($smilies), $texttoreplace);

    return $texttoreplace;

}

 

and I am getting a syntax error here...

 

$startrow=$getmessages3-20;

 

Any help or suggestions would be greatly appreciated.

 

 

 

Notice: Undefined variable: getmessages3 in C:\wamp\www\chat\chatlog.php on line 15

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20,36' at line 1

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.