Re: REMOTE_ADDR problem in CGI mode

From: Date: Thu, 30 Nov 2000 23:39:45 +0000
Subject: Re: REMOTE_ADDR problem in CGI mode
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-4208@lists.php.net to get a copy of this message
Vince: Try using $GLOBALS: $r_hostname = gethostbyaddr($GLOBALS["REMOTE_ADDR"]); When running as CGI, $HTTP_SERVER_VARS only has "PHP_SELF". Saludos, Pablo Vera _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Thursday, November 30, 2000, 5:05:35 PM, Vince wrote: VL> I've got apache 1.3.12 running in both CGI and module modes at the same VL> time. .php4 files are loaded as module and .php are loaded via CGI. The VL> following code only works if the file has a .php4 extension [apache mod]: VL> $r_hostname = gethostbyaddr($HTTP_SERVER_VARS["REMOTE_ADDR"]); VL> print ("$r_hostname<P>\n"); VL> If I run it on a .php file [CGI], I get the error message: VL> Warning: Undefined index: REMOTE_ADDR in .... VL> I used to run CGI and module mode separately [ie: I commented out certain VL> lines in my httpd.conf file to run php ONLY as either a CGI or module] and VL> it would work fine. But when my httpd.conf is set so that I can run both, VL> I get the above problem. VL> What have I broken, and how do I fix this? VL> TIA, VL> /vjl/

« previous php.windows (#4208) next »