Basically I wwant to stop people accessing any pages if they haven't logged in.
I have trying to set a cookie as follows, which I got out af a book..
// set authorisation cookie
setcookie("auth","1",0,"/","",0);
//header("Location: access.php");
}else{ //yourdomain.com
// exit;
}
which seems to work, but when I check it by jumping straight to a page without logging in, with the following:
?php if ($_COOKIE['auth'] == "1"){
I get all sorts of errors on the page like this:
Notice: Undefined index: auth in c:\program files\apache group\apache\htdocs\faultpage.php on line 2
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\apache group\apache\htdocs\faultpage.php:2) in c:\program files\apache group\apache\htdocs\faultpage.php on line 6
I realise setting a cookie ot a value of 1 is a little minimalistic, but I'm just trying to get the code to work, I can change the value later.
chris