Trouble redirecting after cookie is sent
Posted: Fri Jan 30, 2004 11:38 am
Im trying to redirect to a different page depending on whether or not the user has a cookie that was sent to them on a different page.
Here is the Cookie:
<?php
setcookie("affiliate", "washere", time()+60*60*24*30, "/", "merchantequip.com");
?>
Here is the redirect script:
<?php
//If no cookie redirect
if ($_COOKIE["affiliate"] == "washere") {
echo("<meta http-equiv='refresh' content='0;url=sales.php'>");
}else{
if ($_COOKIE["affiliate"] != "washere") {
echo("<meta http-equiv='refresh' content='0;url=sales2.php'>");
}
}
?>
It always redirects to the sales2.php page and I need it to redirect to the sales.php page if the user has the cookie.
Here is the Cookie:
<?php
setcookie("affiliate", "washere", time()+60*60*24*30, "/", "merchantequip.com");
?>
Here is the redirect script:
<?php
//If no cookie redirect
if ($_COOKIE["affiliate"] == "washere") {
echo("<meta http-equiv='refresh' content='0;url=sales.php'>");
}else{
if ($_COOKIE["affiliate"] != "washere") {
echo("<meta http-equiv='refresh' content='0;url=sales2.php'>");
}
}
?>
It always redirects to the sales2.php page and I need it to redirect to the sales.php page if the user has the cookie.
Code: Select all
<?php
?>