Re: http_referer. what's wrong with that?
| From: | Ken Robinson | Date: | Thu, 12 Jan 2012 07:18:04 +0000 |
| Subject: | Re: http_referer. what's wrong with that? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316268@lists.php.net to get a copy of this message | ||
At 12:27 AM 1/12/2012, Haluk Karamete wrote:
Because I got this echo $_SERVER['HTTP_REFERER']; I end up with this Notice: Undefined index: HTTP_REFERER in D:\Hosting\5291100\html\blueprint\bp_library.php on line 16 die; Now, this is of course after the <?php error_reporting (E_ALL); ?> change. One solution is to dodge it by echo @$_SERVER['HTTP_REFERER'];The better way to avoid the error is to do something like echo (isset($_SERVER['HTTP_REFERER']))?$_SERVER['HTTP_REFERER']:'No referrer set'; Which checks to see if it's set before echoing the value. If it's not set, you get a message saying so. Ken