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

Asked

Viewed 397 times

3

My intention is, by the local server, to query data on an external server. I would like to know how to 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 with the server and the server must respond differently for each client. How can I do this only with php and javascript? The logic I know, I don’t know is how to establish this connection.

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

  • You can give a different hashed url one for each client, or give different pages. Something to stop that? or log in. You can explain better what part you can’t do?

  • Well, you can just create a type url meusite.com/c=1and do the handling with php.

1 answer

3


How to do

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

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

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

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.