Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: need very simple code simplette
11-28-2007, 03:40 AM #1TrainReqGuest
need very simple code simplette
So if the page with the sniplet is called upon one time, it will set a session cookie that will expire in 30 seconds named like visited=true , but it will expire in 30 seconds..
but what i would like to acomplish with that is, if they do not have that session set, or if they visited after 30 seconds (after the session has expired), it will header locate to a page like nevervisited.php , but if they visit in the same 30 seconds (before the session expires), it will header locate to alreadyvisited.php
if session cookie of visited is not set, or has expired, redirect to one page, but if it has been set and did not expire , redirect to another.
11-28-2007, 04:53 AM #2
- Join Date
- Nov 2007
- Thanked 0 Times in 0 Posts
to set the cookie for 30 seconds paste this:
$value = "somevalue";
setcookie('visited', $value, time()+30);
header( 'Location: http://www.yoursite.com/this_guy_deffinetally_is_in_session.php' ) ;
header( 'Location: http://www.yoursite.com/this_guy_needs_to_reactivate_his_session.php' ) ;