Connecting a local server to an external server with js and php

3

My intention is for the local server to query data on an external server. I wonder how I could get the external server to wait for the local connection, and depending on that local connection, make different decisions.

Example: I have 2 clients and 1 server, I need to connect these clients to the server and the server must respond differently to each client. How can I do this only with php and javascript? The logic I know, I do not know is how to make that connection.

I'm not asking for ready code, I just want to know the means of how to do it.

    
asked by anonymous 13.05.2015 / 22:06

1 answer

3

How to do

You can make use of WebServices , you can exchange messages (JSON ). To do the communication of the client (local server) with the remote server (where would be the webservices next to the database).

How to differentiate one client from another and technologies to aid / expedite development

To differentiate one client from another you can make use of parameters in the requests AJAX , today there are javascript frameworks that make it easier to make these requests such as ( jQuery and AngularJS ).

  

As you said you are aware of logic, you can work with the methods / technologies mentioned above to achieve your goal.

    
13.05.2015 / 22:36