earth4x
02-22-2007, 03: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!
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!