Page 1 of 1

Help with Calendar Script

Posted: Thu Mar 03, 2005 1:18 pm
by Shyft
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 =)

Posted: Thu Mar 03, 2005 1:34 pm
by feyd
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().

Posted: Thu Mar 03, 2005 3:10 pm
by Todd_Z
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