I am setting up a simple securtiy project. Each page that requires security include a file called called security.inc. This include checks the PHP_SELF variable against a row in my DB and say yes or no. If no i want to redirect to a access denied page but with a link to the refering page. Here is my code:
securuty.inc
$refer = getenv("HTTP_REFERER");
IF NO>
header("Location: http://193.193.113.21/security/admin_error.php?errortype=1&referer=$refer");
exit;
It redirects fine but with no value in the querystring for refer. If i replace the $refer variable with some text or even a web address that passes fine.
Any ideas?
Cheers
Marcus