1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Using PHP/Javascript in a chatroom

Discussion in 'PHP' started by pedrossi, Jan 7, 2007.

  1. #1
    Hi,

    I'm posting this here because my script is written MOSTLY in PHP but what I'm trying to do involves some javascript too so i'm not sure where this post belongs.

    I have a PHP/Javascript chatroom that has a private message capability. On the user list, when one user clicks another user's name, a window will pop up on each user's screen. The problem is, if either user closes his window, the other is able to keep typing and sending messages, but the user that closed the window doesn't get them. I want to fix this by either closing the other guy's window or reopening the window of the guy that closed it when the other guy sends a message. You can see the chatroom here: http://www.felweb.net/work/phpchat/

    What I've been trying to do is to add a javascript code to the popup PHP file that asks the user if he's sure if he wants to close the window. If he clicks "OK", somehow it'll send a variable somewhere that'll force the other user's window to close also.
    Alternatively, when the other user sends a message, the first guy's window would pop back up. But I'm not that good with PHP or Javascript so I need some urgent help :confused: :confused: :confused:

    If you need to see any of the files, I zipped up the whole chat and you can download it here (i wasn't sure which ones to include so I posted them all): http://www.felweb.net/work/phpchat/FELIPECHAT.zip

    All help is appreciated!
    Thanks in advance!!:)
     
    pedrossi, Jan 7, 2007 IP