Search the Community
Showing results for tags 'timing out script'.
-
Hi, this is what I am trying to do: I have to make an enrollment form for a course. I'd like it so that when a date expires it 'dies' and is removed whilst the next date that hasn't come is still 'alive' and when that day comes it 'dies' and so on... So the page would look like this: << ENROLL BUTTON >> June 10th <--- this would have disappeared from view since that day/ date has passed July 10th <-- this is still visible since today is June 29th July 15th <-- this is still visible << ENROLL BUTTON >> I am thinking that when a 'timestamp' variable has expired in just dissapears - but this doesn't work when I tested the below. I think I am missing something very basic - all help very gratefully received! <?php //1. Set the timezone date_default_timezone_set('America/New York'); //2. define the current timestamp $current_timestamp = time(); //3. Define the expiry timestamp $expiry_timestamp1 = mktime(22, 33, 11, 6, 29, 2013); // mktime(hr,mins,sec,mth,day,yr) $expiry_timestamp2 = mktime(23, 34, 11, 6, 29, 2013); // mktime(hr,mins,sec,mth,day,yr) $expiry_timestamp3 = mktime(23, 35, 11, 6, 29, 2013); // mktime(hr,mins,sec,mth,day,yr) if($current_timestamp < $expiry_timestamp1) { // insert content here that you want showing as long as the current_timestamp is less than the expiry_timestamp. echo "This is within the deadline 1"; } if($current_timestamp < $expiry_timestamp2) { // insert content here that you want showing as long as the current_timestamp is less than the expiry_timestamp. echo "This is within the deadline 2"; } if($current_timestamp < $expiry_timestamp3) { // insert content here that you want showing as long as the current_timestamp is less than the expiry_timestamp. echo "This is within the deadline 3"; } // insert a message which shows that the content is now hidden. else { echo "This is not"; }