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

    Question Sending variable when window closes?


    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

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

  • #2
    Regular Coder
    Join Date
    May 2005
    Michigan, USA
    Thanked 0 Times in 0 Posts
    You are not going to find many people that will help you with your solution. Number one there are quite a few files in there that will probably need changing. Number two is the fact that you have not really researched where the problem could be and/or the correct way to handle this. We are here to help you along with your solution, not re-write alot of code for you.
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.


    Posting Permissions

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