Forum Moderators: coopster
I have a script that shows the referring sites but the error_log is full of these PHP Notices. I know it's not a big deal and notices can be turned off but I'd like to fix it since there are 20K+ of these per day and need to watch for other notices.
The error says it's the second line.
putenv ( "REMOTE_ADDR=".$HTTP_SERVER_VARS["REMOTE_ADDR"] ) ;
if( $HTTP_SERVER_VARS["HTTP_REFERER"] ) {
putenv ( "HTTP_REFERER=".$HTTP_SERVER_VARS["HTTP_REFERER"] ) ;
} else { putenv("HTTP_REFERER=noref"); }
PassThru("./path/to/script");
I'm using PHP 5.1.6 and register_long_arrays is turned on.
Should it use isset like
if(isset ( $HTTP_SERVER_VARS["HTTP_REFERER"] ))
and should I change all of those $HTTP_SERVER_VARS to $_SERVER
I would use empty [php.net], then you could test whether not set or empty it would put 'noref'