Forum Moderators: coopster

Message Too Old, No Replies

Redirect

on first time visit

         

cmatcme

4:33 pm on Jan 29, 2005 (gmt 0)

10+ Year Member



Does anybody know a php script for first time redirection?

dcrombie

12:33 pm on Jan 30, 2005 (gmt 0)



Something like this (must appear before ANY HTML is output):

setcookie("visited", true, time() + 30*86400); # expires in 30 days 
if(!isset($_COOKIE["visited"])) {
header("location:someotherpage.html");
exit;
}

;)

Zipper

5:56 pm on Jan 30, 2005 (gmt 0)

10+ Year Member



shouldn't the cookie be set within the condition, and not before it

Warboss Alex

9:39 pm on Jan 30, 2005 (gmt 0)

10+ Year Member



doesn't matter in this case.