[ciapug] php SuperGlobals issue
Carl Olsen
carl-olsen at mchsi.com
Tue Mar 7 17:33:28 CST 2006
I always install a file with this code in it:
<?php
phpinfo();
?>
It should tell you what the value of $_SERVER['REMOTE_ADDR'] is. If it
doesn't, you've got a setup issue.
Carl
-----Original Message-----
From: ciapug-bounces at cialug.org [mailto:ciapug-bounces at cialug.org] On Behalf
Of vanish at dreamscapevisionery.com
Sent: Tuesday, March 07, 2006 9:09 AM
To: ciapug at ciapug.org
Subject: [ciapug] php SuperGlobals issue
I'm hoping someone out there can figure out how I've screwed this up...
In an include file, I have the following code:
$sec_ip = $_SERVER['REMOTE_ADDR'];
Which should set the variable to the IP address of the visitor's PC. In my
setup, however, it displays the server's IP instead. I tried replacing that
with:
$sec_ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
to see if the problem was a proxy issue, but alas no ip is shown. (Yes, I
tried
the getenv method as well and the $ENV method also. All return the same
result)
Setting the variable form the original code page has the same effect so it's
not
some funky problem caused by being in an include file.
Any ideas? Anyone? Bueller? Bueller?
Chris VC
_______________________________________________
ciapug mailing list
ciapug at cialug.org
http://cialug.org/mailman/listinfo/ciapug
More information about the ciapug
mailing list