Jump to content

Recommended Posts

Fair warning, I know nothing of php syntax, only what I need to do.  ;D

 

I know that

 

echo date("l, F d, H:i");

  will get us:

Saturday, August 04, 16:47

 

So, what I need to end up with is something like:

 

"if day of week is saturday or sunday OR time is less than 7:30am AND greater than 3:30pm, go to afterhours.htm

else

go to businesshours.htm"

 

Can anyone help me with that?

 

Which is fine, I do have a snippet that would put me on the right track with that, but it doesn't take into account days of the week, or minutes:

 

echo "<script language=\"javaScript\" type=\"text/javascript\">\r\n"
. "todaydate = new Date();\r\n"
. "timeis=todaydate.getTime();\r\n"
. "todaydate.setTime(timeis);\r\n"
. "houris = todaydate.getHours();\r\n"
. "if(houris<=15 && houris>7) {\r\n"
. "location.href='http://www.website.org/main/businesshours.htm';\r\n"
. "}\r\n"
. "else{\r\n"
. "location.href='http://www.website.org/main/afterhours.htm';\r\n"
. "}\r\n"
. "</script>\r\n"
. "</span>\r\n";

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.