php / java message popups

Posted on 2012-08-21
Last Modified: 2012-08-22
I would appreciate some suggestions on the following:

An website page will have records on it which will be updated on a computer in an office accessing this website on the local server.
When the records are submitted  and the appropriate database is updated, another page being accessed on the same website / server but using a computer in another office in the same building needs to get a pop up message saying that a record has been updated.

Would I use sessions for this ?
Question by:doctorbill
    LVL 17

    Accepted Solution


    No, you would need to use some type of AJAX Polling. Initial thought would be that when the appropriate database is updated, write a record to another table in that database that just stores when the last update happened. Then use Ajax to check that table on an interval and if the date/time of the previous is less than the date/time of the current check then pop up a message using alert or a jquery/lightbox popup.

    Or if all of this is happening on the same windows network you could possibly just use "net send" or "msg" command depending on your version of windows to send a message to the other computer.

    You could also just use an instant messenger to the send a message to the other computer that it has been updated.
    LVL 107

    Expert Comment

    by:Ray Paseur
    No points for this (jrm213^2 has given the right answer).  Just wanted to let you know that under the rules of HTTP client-server systems, clients make requests and servers make responses.  And that's all.  Servers cannot initiate any action on a client machine.  That's why you need the AJAX polling.  AJAX will make repeated requests, thus simulating an event listener.

    An md5() string is a useful thing in this design.  When it changes, that is because the input to md5() changed.  I use that design to monitor web directories.

    Best of luck with it, ~Ray

    Author Comment

    could you give me some example scripts / pages please

    Author Closing Comment

    Thanks very much for the advice. I found a message script called Blab which works very well, and one called php 121

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to dynamically set the form action using jQuery.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now