Day of the Week Content Design Question

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
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Day of the Week Content Design Question

Post by tecktalkcm0391 »

Okay, I have this website with 5 Tabs for Monday through Friday... I have weeks worth of content to be posted the next time that day comes up...

For example:
If today is Thursday .... then....
Monday's content is this weeks Monday content
Tuesday's content is this weeks Tuesday content
Wednesday's content is this weeks Wednesday content
Thursday's content is this weeks Thursday content
Friday's content is last weeks Friday content.

How could I make a script to do this, in which it just prints the date of the Day of the Week for each link... because I just need it to go to MMDDYY.html... because that is were the content is for that day...

Thanks for the help!
Last edited by tecktalkcm0391 on Fri Oct 24, 2008 2:50 pm, edited 1 time in total.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: Day of the Week Content Design Question

Post by onion2k »

Code: Select all

SELECT `content` FROM `table` WHERE DAY(`live_date`) = DAY(CURDATE()) AND `live_date` < CURDATE() ORDER BY `live_date` DESC
Obviously if you don't want the content for today just swap CURDATE() for a date.
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Re: Day of the Week Content Design Question

Post by tecktalkcm0391 »

The content is not in a database, the are just HTML files, stored in a directory...

I just can't think of the logic to do it in a IF command in PHP...
Post Reply