...

View Full Version : Need help building a chat



earth4x
02-22-2007, 04:21 AM
'm trying to build a small chat in PHP, but i'm having some slight problems and need some help.

first off, I want to use emoticons, and I want to use the str replace code to make it work, but it doesn't...

$smile = str_replace(":)", '<img src="c001.gif">', "$msg";

$msg being the $_POST of a text field (I use a txt file with fwrite to build the chat)


can anyone tell me what i'm doing wrong ?


also, I want to be able to see how many users are connected to the page, without using MySQL. Can anyone guide me on how I can do this? I already have each user login and it creates a $_SESSION['username'] so i'm guessing I can make it work.. but I don't know how


thanks!

Nightfire
02-22-2007, 04:43 AM
$smile = str_replace(':)', '<img src="c001.gif">', "$msg");

earth4x
02-22-2007, 09:06 PM
I already had the ) at the end ... don't know why it didn't paste it in here, otherwise it would've given me a syntax error.

i'm still stuck, can't find a way to make this work!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum