- Messages
- 3,819
- Reaction score
- 163
- Points
- 63
Hey, I was wondering how I could set a cookie that redirects a visitor to a homepage after they visit a intro page. Is there a way to do this?
if( $_COOKIE['cookiename'] ) {
echo '<meta http-equiv="refresh" content="10;URL=http://url" />';
}
header("location:some_url.php");
if(isset($_COOKIE['COOKIENAME'])){
header("Location: ./#.php");
}else{
setcookie("COOKIENAME", TRUE, time()+7200);
header("Location: ./#.php");
}
<?
if(!empty($_COOKIE['visit']))
header('location:somesite.php');
$cookie_result = setcookie("visit", true, time() + 3600);
if(!$cookie_result)
$message = "Please enable cookies within your browser";
else
header('location:index.php');
?>