php / java message popups

Posted on 2012-08-21
Medium Priority
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
  • 2
LVL 17

Accepted Solution

jrm213jrm213 earned 2000 total points
ID: 38317290

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 111

Expert Comment

by:Ray Paseur
ID: 38318141
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

ID: 38318214
could you give me some example scripts / pages please

Author Closing Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses
Course of the Month17 days, 11 hours left to enroll

830 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