SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: popup window

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    popup window

    hi to all,

    This is regarding chat private messaging.

    I have a list of users online on my site, Once I dblclick one of them then the new div window will popup which is I've already done. My problem now is, once I already type a message and enter, how another div window will popup to the pc of the user I was hit. I don't know how to start. I have no idea how to do this. First thing trouble in my mind is, how can I sense that this window should popup to the specific user pc?

    Any idea or suggestions

    Thanks in advance

    Tirso

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want the message to appear without the user having to reload the page, you will need to poll your webserver periodically using ajax. For example, every 10 seconds, ajax will fetch a url. This url should be a serverside script like php/jsp/asp etc...The script uses some kind of id, probably a session id, to find out the users username(stored in the users session). Then, a query is made against the database to find new messages.

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2008
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi crmalibu,

    Thanks for your immediate replied, Actually I know how to query the messages in my database and fetch it in every 10 seconds. My problem is to display the popup window with the specific user which the message appear. Because if I only display the window as normal display, maybe all the users will see this window.

    thanks

    Tirso

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    But if it's keyed to some form of ID, then you can display messages specifically to an ID - even on a public website.
    Ian Anderson
    www.siteguru.co.uk


Bookmarks

Posting Permissions

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