for some reason the cookies dont seem to be working, they work like this, you log in it sets 2 cookies 1 cookie named 'user' with your username the other 'pass' with your password, on the header of each page it queries the database and if the username and password match up the itll display some stuff the you can edit/check/ect and the such, for some reason it only works on the button.php page all the other pages wont work...
normal pages look something like this:
Code: Select all
<?PHP
include('header.php');
echo 'stuff here';
include('footer.php');
?>
the cookie depends on a checkbox hour or month
Code: Select all
<?PHP
//most stuff at the top
if ($length=='hour') {
setcookie ('user', $user, time()+3600, '', '', 0);
setcookie ('pass', $pass, time()+3600, '', '', 0);
}
else {
setcookie ('user', $user, time()+2592000, '', '', 0);
setcookie ('pass', $pass, time()+2592000, '', '', 0);
}
//more stuff down here
?>
this only seems to work on the 'button.php' page, im not sure how his is working... but I decided to try and echo a few things out and the cookies dosnt seem to be working at all except on that page anybody know whats up... I may just have think of a new way to do this, by like encrypting an variable with the user/pass/expire and such like that kind of thing