Help with Calendar Script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Shyft
Forum Newbie
Posts: 7
Joined: Sat May 22, 2004 3:03 pm

Help with Calendar Script

Post 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 =)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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().
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post 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
Post Reply