Hi there,
This will probably be easy for you guys.
I'm trying to run an echo print based on a certain time and the actual day.
Required values are after 5pm and before 9am and on a Sat or Sun.
This is what i have but it doesnt work properly. Any pointers?
$today = date("w");
$current_time = date(G);
if ( $current_time < 9 || current_time > 17 || $today==0 || $today==6) {
echo "I'm sorry you have reached us out of hours!<br> Please try again between Mon-Fri 9am-5pm.";
exit;
}
Thanks in advance..
PHP Newb issue with time and date
Moderator: General Moderators
Re: PHP Newb issue with time and date
Hello,

Change toif ( $current_time < 9 || current_time > 17 || $today==0 || $today==6) {
Let me know if that helps, also try enabling error reporting etc so you can see.if ( $current_time < 9 || $current_time > 17 || $today==0 || $today==6) {
Re: PHP Newb issue with time and date
Thanks for the reply. I see i missed the $ sign.
Ha ha maybe thats it..
Ha ha maybe thats it..