Closed Thread Icon

Topic awaiting preservation: PHP: Date script (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=13122" title="Pages that link to Topic awaiting preservation: PHP: Date script (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP: Date script <span class="small">(Page 1 of 1)</span>\

 
DaveFA
Obsessive-Compulsive (I) Inmate

From: USA
Insane since: Feb 2004

posted posted 04-05-2004 16:56

I'm mostly an ASP developer, and I've been stuck with a php project. I've just started picking up on php a few days ago, so I apologize that my question is pretty elementary. Basically, I want to convert a javascript calendar to php. Here's the code for the javascript calendar:

<script language="JavaScript" type="text/JavaScript">
now = new Date()
if (now.getDay() == 5)
document.write("Today is Friday. Information for Friday goes here.")
if (now.getDay() == 6)
document.write("Today is Saturday. Information for Saturday goes here.")
if (now.getDay() == 0)
document.write("Today is Sunday. Information for Sunday goes here.")
if (now.getDay() == 1)
document.write("Today is Monday. Information for Monday goes here.")
if (now.getDay() == 2)
document.write("Today is Tuesday. Information for Tuesday goes here.")
if (now.getDay() == 3)
document.write("Today is Wednesday. Information for Tuesday goes here.")
if (now.getDay() == 4)
document.write("Today is Thursday. Information for Tuesday goes here.")
</script>

I know, simple. Yeah, simple for me if it was ASP or ASP.NET, but no, alas it's PHP. Any help would be appreciated. Thanks.

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 04-05-2004 17:01

the php date function in conjunction with the appropriate format string (w, I believe) should get you started.

« BackwardsOnwards »

Show Forum Drop Down Menu