dvayne Posted April 1, 2008 Share Posted April 1, 2008 the admin will post opening and closing date. The members will be able to post with given period. If the time will lapse, there will be displayed something. please help me..... for example april 1, 2008 - april 3, 2008, if april 4 now, members will not be able to post Link to comment https://forums.phpfreaks.com/topic/99065-opening-closing-date/ Share on other sites More sharing options...
soycharliente Posted April 1, 2008 Share Posted April 1, 2008 Use this as a base ... <?php $start = //something $stop = //something $now = time(); if ($now > $stop) { echo "No more posts."; } ?> Link to comment https://forums.phpfreaks.com/topic/99065-opening-closing-date/#findComment-506918 Share on other sites More sharing options...
Barand Posted April 1, 2008 Share Posted April 1, 2008 to compare dates they need to be in YYYY-mm-dd format or as unix timestamps. Using the latter <?php $start = strtotime('april 1, 2008'); $end = strtotime('april 3, 2008'); $now = mktime(0,0,0); if ($start <= $now && $now <= $end) { echo "OK to post"; } else { echo "No posting" } ?> Link to comment https://forums.phpfreaks.com/topic/99065-opening-closing-date/#findComment-506922 Share on other sites More sharing options...
dvayne Posted April 2, 2008 Author Share Posted April 2, 2008 thank you, I will try Link to comment https://forums.phpfreaks.com/topic/99065-opening-closing-date/#findComment-507339 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.