0

I am having some problems with the code to access a remote website server2 from another website server1. The code I use from inside the server2 to log in is the following code:

require_once("http://server2.com/access/models/config.php");
if (!securePage($_SERVER['PHP_SELF'])){die();}

//Prevent the user visiting the logged in page if he/she is already logged in
if(isUserLoggedIn()) { header("Location: http://server2.com/access/account.php"); die(); }

What I do know is that I can not use require/include code as those codes are used to call the php file from inside the server. Does anybody know how, where or what is the code to login from a remote server to another server?

1 Answers1

2

Because of safety issues you cannot view external php files directly.

If you want to access information from server2 I suggest you create a RESTful service or some other API on the remote server for communication between your servers.

Joren
  • 3,068
  • 25
  • 44