Trying to use Cookies with Include()
Posted: Mon Aug 01, 2005 3:25 pm
Hello. At the moment, I'm trying to have this file:
Become called on a page using include(). However, on my pages, I get the 'working' text, yet cookies aren't set. I'm calling the function before any HTML. In short, I suppose I'm asking if cookies can be set using an included file, as that can be the only possible cause of this problem I can see at the moment. However, any help would be apprichated.
--- Luke
EDIT: Err... I suppose it's been said elsewhere on forums, but PHP tags ([php]) don't seem to be working.
Code: Select all
<?php
if ($_COOKIE['slot1'] == 'none')
{
$cookiesalreadyset = 1;
} else {
setcookie ('slot1', 'none');
setcookie ('slot2', 'none');
setcookie ('slot3', 'none');
setcookie ('slot4', 'none');
setcookie ('slot5', 'none');
setcookie ('slot6', 'none');
setcookie ('slot7', 'none');
setcookie ('slot8', 'none');
setcookie ('slot9', 'none');
setcookie ('slot10', 'none');
setcookie ('all', 'none');
}
echo ('working'); //debugging
?>--- Luke
EDIT: Err... I suppose it's been said elsewhere on forums, but PHP tags ([php]) don't seem to be working.