I am creating a website in which people order takeaways online. How can I only allow access to webpage at certain times of day? e.g. 5pm – 12pm etc…
Update:
I have figured out a solution which works with number of answers:
<?php
if (date('G')>17) {
header('Location: /closed.php');
exit();
}
?>
I would suggest you just build this check into the page itself. That way if it is outside the time you can return a page telling the users to come back between these certain hours. Here is one way to do this: