Close a section of my site at certain times...
Posted 23 March 2006 - 04:55 PM
I was thinking something that would go like this:
IF Time (is greater than) closetime (then)
But I would need to figure out how to pull time from the server and make sure it is correct, etc.
I would either set-up a header redirect for the (then) or just set something like closed = true and make some more IFs disabling links.
This is an dynamic site that has different businesses listed on it (just an fyi). I don't think Ill need help making this work with the site...I just need to know how to use real time.
Posted 23 March 2006 - 06:09 PM
if(date("G") > 17)
exit("SORRY THIS PAGE IS CLOSED BECAUSE ITS PASSED 5PM, SERVER TIME");
Posted 23 March 2006 - 06:11 PM
<?php $closeTime = "1700"; // 5PM $time = date("GH"); // 24 hour time with leading zero's if ( $time > $closeTime ) die ("the website is closed after business hours"); ?>
I'm sure you'll want it to be more elaborate.. but you get the idea
Come visit my site to see my latest projects
Posted 23 March 2006 - 06:45 PM
I can't stop you from doing something silly, but at least I can help you do it right.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users