I don't really know where to begin on this one. Basically, what I am trying to do is develop a script with 2 pulldown menus, one to select the month, and one to select the year. Then, a table is displayed with a calendar for that month. IE: If February 1st of 2007 is a Sunday, it will begin on sunday. Just like a real calendar. I got it half way there w/o the system clock, but I would like to switch over to using that. What sort of commands would I need for that? I'm still fairly new to PHP and MySQL as well as programming in general. I've been doing semi-basic stuff for about a year now.
Also, any help on what sort of logic I should use to work out a design would be greatly appreciated!
Thanks everyone =)
Help with Calendar Script
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I don't see a connection to databases.. so moving to PHP - Code.
mktime(), checkdate(), strtotime() can all help.
I'd suggest validating the passed info through checkdate(), then using mktime().
mktime(), checkdate(), strtotime() can all help.
I'd suggest validating the passed info through checkdate(), then using mktime().
Check out http://www.acdrifter.com/Calendar (register - its free) to check out my layout and all that crap, that might get some ideas and inspiration for ya. If you have any questions on how i did something you can always ask.
A few classes used in my script: (View Source)
http://www.acdrifter.com/Calendar/MonthClass.php.txt
http://www.acdrifter.com/Calendar/DayClass.php.txt
A few classes used in my script: (View Source)
http://www.acdrifter.com/Calendar/MonthClass.php.txt
http://www.acdrifter.com/Calendar/DayClass.php.txt