Hi, Slight issues, I have two machines, A and B. A simplified version is that... Machine B serves a webpage. (The page must live on this server) Machine A gets the webpage using a file get contents and displays the page to the end user. This works fine. However the log files of B always show machine A as the IP address, which is correct. However it would be much better if machine B had the users IP address within the Log files. Is this possible? and if so, how? Thanks
I don't know exactly how your script works, but I would do it like that Server A: first you get the ip of the user: if ($_SERVER['HTTP_X_FORWARD_FOR']) { $ip = $_SERVER['HTTP_X_FORWARD_FOR']; } else { $ip = $_SERVER['REMOTE_ADDR']; } PHP: then send the ip to Server B with a parameter: $data = file_get_contents('http://www.serverb.com/content.php?ip='.$ip); PHP: Server B: There you go, here is the IP of the user. Now you can add it to your log! $ip = $_GET['ip'] PHP: