0

Even figuring out how to ask this question is difficult, so here goes.

I have a basic web application that (overly simplified) takes names, adds them to an html table and enters them into a MySQL database table. This is done in a very traditional way using PHP/Ajax/jQuery type coding and shows the new entry without a screen refresh.

I'm not right now interested in concurrency type issues. What I need to know is how to show an update one person makes in his web page on the other persons page without either doing a screen refresh.

So if me and Jim are both on the same web app but in different physical locations and I add a name to the table, I want that name to appear immediately on his screen too. And of course should he add a name, I want to see it on my screen immediately as well.

I'd like to do this without a complete screen refresh.

How is this done?

Keith D Kaiser
  • 1,016
  • 2
  • 14
  • 31
  • like, how stackoverflow/facebook notifications come without page refresh. Am i correct @Keith D ? – Nana Partykar Aug 26 '15 at 15:23
  • What you tried anything? Where is your example code? – 099 Aug 26 '15 at 15:24
  • Have you taken a look at the [Comet](http://stackoverflow.com/questions/8118828/how-to-implement-comet) method? This seems to be what you're going for! Essentially you'll have to get the page to receive a notification when User 2 changes the websheet and then call a function that just updates the value displayed in your sheet as User 1. I'm not so sure about the second part as I'm not sure if this can achieved with php - you might have to take a look at using a different language for this! Hope this helps :) – Imran Ahmed Aug 26 '15 at 15:28
  • 099 How can I give example code when I don't have a clue how to even start doing it? – Keith D Kaiser Aug 26 '15 at 15:40
  • @Jason - there wouldn't be an instant update though (unless you request your server every second which might be a bit overkill!). The COMET method is the method that Facebook uses to give you notifications which is pretty cool and exceptionally elegant! – Imran Ahmed Aug 26 '15 at 15:41
  • Both users would be editing the page simultaneously. So they would both need to see the others changes immediately. I knew this would be hard to explain... sorry guys. – Keith D Kaiser Aug 26 '15 at 15:41
  • I'm looking at COMET now. So far it looks like the answer. – Keith D Kaiser Aug 26 '15 at 15:57
  • @KeithDKaiser Great!! Hope you manage to get everything up and running! :) – Imran Ahmed Aug 27 '15 at 12:41

0 Answers0