Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help building a chat

    '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!

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    $smile = str_replace('', '<img src="c001.gif">', "$msg");

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •