I am testing different methods of loading a PHP file located on a separate server, I noticed that the IP address that is calling the external file is from my local IP and not the server IP. Is this always the case or is there a way to load an external PHP file from the server IP?
The load function I am currently testing is -
$("button").click(function(){
$("#contents").load('http:server-address/test.php?id=55');
});
In the PHP file I have simple -
if(isset($_GET['id'])){
$id = $_GET['id'];
echo $id;
}
$ip = $_SERVER['REMOTE_ADDR'];
echo $ip;
Which everything works fine but the $ip is from my home IP address and not my .com server.. Why is this?
The reason I ask is simple, I have to create permissions for the external server to allow each accessing IP address, I only want to allow one IP which is my .com sever, it would be impossible to know everyone's IP that might access the server so I would have to allow all access which obviously I cant do.