Jump to content

show/hide content - expiration date


wkilc
Go to solution Solved by fastsol,

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.