|
Why cant i re-direct users!
I am making a blog, it allows for a user to read stories and an admin to add, edit and delete stories. What i want to do is put a login page if the user has not already...
What i do is if a user accesses the page that is for admins, and they dont have access (a cookie thats created when they login) then it will re-direct them to the login page...
When i try and re-direct the user, using the code below:
<?php
$cookie = $_COOKIE["auth"];
if (!$cookie =="denied")
{
header("Location:./loginpage.php");
}
?>
i get the error: "Warning: Cannot modify header information - headers already sent by etc"
What do i do to fix this error!!!
|