Hi,
Can someone help me. I have no idea why I keep getting this error, as as far as I can find out the syntax is correct.
header("Location: $_SERVER['HTTP_REFERER']");
The error I get is:
PHP Notice: Undefined index: 'HTTP_REFERER' in c:\apache\apache2\htdocs\TMP6yxo8e5lhx.php on line 7.
Thank you to anyone who can help!
RedRasper
$_server['http_referrer'] problem
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Basically, a value for HTTP_REFERER hasn't been set - you could test to see if the information exists and redirect to a default page if it hasn't:
Mac
Code: Select all
$redirect_url = (!empty($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : 'http://www.mysite.com/default.php';
header("Location: $redirect_url");