Forum Moderators: coopster
<?php
setcookie('city', 'fresno', time(360000)); ?>
it sets this cookie on the fresno.php page, now what i need is an if statement on the index page that says if the cookie's value is 'fresno' then it will redirect to fresno.php?
Any goes?
<?php
if (isset($_COOKIE["city"])) {
if ($_COOKIE["city"] == 'fresno') {
header("Location: fresno.php");
}
}
if (isset($_COOKIE["city"])) {
if ($_COOKIE["city"] == 'oakland') {
header("Location: oakland.php");
}
}
?>
but now i need a way for them to go back to the index page so they can delete the cookie if you will so they choose another city