I'm working on an online ordering website for our takeaway restaurant. I have to prevent people from placing orders before 5pm and after 11.30 pm (server time). I'm using OpenCart, php. Could somebody write me a script that I could insert, that outside of these hours would display a message and would block the access of the site/service, please? Thanks in advance!
Asked
Active
Viewed 172 times
-3
-
2What have you tried? Checking whether the current time is between 5 and 11:30 is really not rocket science... – deceze Feb 03 '12 at 04:59
1 Answers
2
if (strtotime('5pm') <= time() && time() <= strtotime('11:30pm')) {
// we're in business
} else {
// we're not
}

deceze
- 510,633
- 85
- 743
- 889
-
Thanks decezee. I will try it. I never said I was a rocket scientist. I found this forum on google, didn't know it's only for pros. – Zsolt Feb 04 '12 at 04:01
-
-
Please take a moment to look around what Stackoverflow is. It's a site to answer specific programming questions that are otherwise hard to find an answer to. We suppose you have already done your homework but were not able to find a solution regardless. It's not a site to get free code. – deceze Feb 04 '12 at 04:24
-
Well, for me it was hard to find the answer. And yes I might have chosen a university course or read a few books if I'd had a few years, instead of asking somebody who knows the answer in a minute anyway. Still I understand that it's rude to ask basic help from people who spent many years and much money on educating themselves, instead of learning and this is a forum for the more complex mysteries of the programming universe and not a sandbox for freeloaders like me. Thank you for your precious time again. – Zsolt Feb 04 '12 at 04:51