0

hey guys I'm totally new to programing and I need your help to walk me through this .

lets say we have 2 users that want to communicate through HTML forms

The first users fills out a html form ( first name , last name , age etc ... ) and submits it . The second user receives the form without being able to apply any modifications to it and then submits back to the first user as either approved or disapproved ( by ticking a radio button )

all of this has to happen in Real Time.

can somebody please explain to me how it works ? Is it done with Ajax ? what should i research ?

DavidNy
  • 61
  • 7

1 Answers1

1

You should look into Web Sockets, this is how you can accomplish the functionality you would like. Here is a link to some information on web sockets and it has a few different libraries that implement and abstract web socket to make it easier to use:

https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API

If you develop in Visual Studio with .NET, then you can check out Microsoft's SignalR library. It makes WebSocket coding easy:

http://www.asp.net/signalr

If you are wanting to stay away from WebSockets completely, then you would be looking to use AJAX and "Long Polling". here is a good SO post on this:

how does long polling work javascript?

Community
  • 1
  • 1
Russell Jonakin
  • 1,716
  • 17
  • 18
  • is it possible to avoid all API and just stick with PHP/AJAX ? – DavidNy Jul 12 '16 at 22:41
  • @DavidNy I guess you would be looking for Ajax Long Polling to do what you need. It was how you could accomplish this type of task before there were WebSockets. – Russell Jonakin Jul 12 '16 at 23:19
  • @DavidNY I edited the answer to include how to do what you wanted without WebSockets. Is that what you neede? I am not sure of any other way to achieve what you need. – Russell Jonakin Jul 13 '16 at 03:37