I want to check if a cookie called www.oclove.com exist. If it does not, then go to login.php. If it does then load the current page. I'm going to drop this code in on about 3,000 pages so I can't use the current page name, I just want to say - load the current page. How do I do this? I think I'm fine up until else then I don't know what to do. I just went with header("#") because I'm stuck. Here's the code:
<?php $_COOKIE['www.oclove.com']; ?>
<?php if(empty($_COOKIE['www.oclove.com'])){
header("Location: http://www.oclove.com/login.php");
} else {
header("#");
}
?>
Also can I call my cookie the same name as the site or is that lame? ....Yes I'm new.