I have two servers, server 1 (the host) is provide content to server 2 (the client).
On server 2 I am using
file_get_contents('http://ift.tt/1MCsR7t');
to retrieve the requested file content. But before this content can be retrieved on server 2 I would like to implement some sort of authentication (username/password). I was thinking about including a username and password query in the url for fgc and checking the db on server 1 before the content is sent back but there will be some cases where the fgc content will need to be printed multiple times through a loop so if the fgc is called say 10 times I don't want to hit the db on server 1 10 times.
So basically I would like to be able to make one call to an auth file on server one or something similar that will give access to the content fetched by the fgc. Maybe with JSON or something? But I've never used JSON with php so I'm not sure how that would work.
Any help would be greatly appreciated. Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire