Jump to content

show/hide content - expiration date


wkilc

Recommended Posts

Hi,

 

I want to set two expiration dates in a form.  Prior to the fall deadline, options A, B, C are displayed.  After the fall date has passed, only A and B will be displayed.  This works beautifully:

<?php
//SET THE TIME ZONE
date_default_timezone_set('America/New_York');
 
//CREATE TIMESTAMP VARIABLES
$current_ts  = time();
$fall_deadline_ts = mktime(0,0,0,9,1,2014);
$winter_deadline_ts = mktime(0,0,0,12,1,2014);
 
//IF THE FALL DEADLINE HAS PASSED
if($current_ts > $fall_deadline_ts) {
     echo "a, b";
} else {
     echo "a, b ,c";
}
?>

How can I tweak this so that after the Winter deadline has ALSO passed, it will only display A, rather than A, B?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/290478-showhide-content-expiration-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.