I have a little problem with PHP, probably for most of you it's a stupid problem, but I need your help.
Here's my code:
function is_logged() {
if(isset($_COOKIE['username'])) {
return true;
} else {
return false;
}
}
And here is a piece of the whole code where I need to deny someone the access if isn't logged.
if(!is_logged()) {
header("Location: ./?act=Home");
}
Where do I made the mistake?
EDIT: I'm sorry, I haven't explained the problem at all... This function does not redirect, leaving blank the page!