Lol5916 Posted September 8, 2008 Share Posted September 8, 2008 Here's the error: Notice: Undefined index: HTTP_REFERER in /home/*******/public_html/******/referer2.php on line 5 Script is: <?php ini_set('display_errors', 1); error_reporting(E_ALL); $line = ('------------------------------------------'); $ref = $_SERVER['HTTP_REFERER']; $ip = $_SERVER['REMOTE_ADDR']; $d = date('l dS \of F Y h:i:s A'); $mes = '<br>Referer: '.$ref."<br>"; $mes = 'IP: '.$ip."<br>"; $mes = "Date & Time: ".$d."<br>"; $mes = ".$line."; $file = "logger.html"; $fh = fopen($file, "a"); fwrite ($fh, "$mes\n"); fclose($fh); ?> What's the problem? Quote Link to comment Share on other sites More sharing options...
shedokan Posted September 8, 2008 Share Posted September 8, 2008 maybe it's because no page has reffered to this one. try to make a page which redirects to that page and see whether it's the problem or not. Quote Link to comment Share on other sites More sharing options...
Lol5916 Posted September 8, 2008 Author Share Posted September 8, 2008 Nope, that's not the problem. Quote Link to comment Share on other sites More sharing options...
toivo Posted September 8, 2008 Share Posted September 8, 2008 This is not an error but a notice only, and there are ways to turn them off if you want. Depends on how tidy you want your code to be, of course. Before you refer to the value in the array, you need to check if it is set. Not all user agents set the value for $_SERVER['HTTP_REFERER']. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.