I keep getting these errors in my log files: [Sun Jul 31 05:50:04 2011] [error] [client xxxxxxxxxx] PHP Notice: Undefined index: HTTP_REFERER in /home/webadmin/xxxxxxxxxxx.com/html/include/common.php on line 491 Line 491 is a line that (I think) records someones IP when they submit an article to the site: $l_sReferer = isset($_POST['referer']) ? trim($_POST['referer']) : base64_encode($_SERVER['HTTP_REFERER']); Can anyone tell me how to fix this error? Cheers
Well, it's not an error just a notice. It seems that $_SERVER['HTTP_REFERER'] is undefined. You can change the line: $l_sReferer = isset($_POST['referer']) ? trim($_POST['referer']) : (isset($_SERVER['HTTP_REFERER']) ? base64_encode($_SERVER['HTTP_REFERER']) : false); PHP: This way it checks whether HTTP_REFERER is set and if it is not, returns false.