http://tekcube.net/wp-content/themes/tekcube/thing.php
This is a date calendar I'm using, and it works great... for people living in Texas, where my server is. I want one that shows the users date, so I started coding in Javascript. I've gotten this far, but I don't know how to display an image depending on the actual DAY.
The date images are capitalized 3-letter names, i.e. Dec, Mar, Apr.
The day images are numbers without leading zeroes, i.e. 1, 9, 25.
Here's the PHP:
Here's the Javascript so far:PHP Code:<img src="/images/date/<?php echo date("M"); ?>.jpg" alt="<?php echo date("M"); ?>" /><br /><img src="/images/date/<?php echo date("j"); ?>.jpg">
I have Googled this relentlessly and came to no avail.Code:<script language="javascript" type="text/javascript"> var months = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); var thetime = new Date(); var themonth = thetime.getMonth(); document.write('<img src="/images/date/' + months[themonth] + '.jpeg" alt="' + months[themonth] + '" />'); </script>
Thanks, Boonzeet.




Reply With Quote