Forum Moderators: coopster
Could anyone pls help?
In fact, it shouldn't be a scope issue should it? - I know that some of the old variables like $REMOTE_ADDR do function oddly in newer versions of PHP...
True, locally included files inherit the variable scope of the including file, but I never trusted those register_globals_on globals and Iīm not sure it really worked that way.
Andreas
When I run the included file seperately, it returns the user IP. If I run this file after being included into another program, I get my server's IP address.
I am not sure what you are doing. Let's say you are including "file1.php" into another program "file2.php". If your file2.php was launched in response to the same request from the same client, all the globals should be the same. The only time $_SERVER["REMOTE_ADDR"] should contain the ip address of the server is when the server requested the file. Do you think that may be happening?
The only time $_SERVER["REMOTE_ADDR"] should contain the ip address of the server is when the server requested the file.
Thatīs why irock tried to include the file using the filesystem instead of http. It still showed the serverīs ip address.
Andreas