Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell driver drivers email error ethernet excel firefox firefox 3 freeze game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows vista windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Getting a diffrent page to display everyday.


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
12-Sep-2006, 02:01 PM #1
Question Solved: Getting a diffrent page to display everyday.
I was wondering if there is a way to get a way for a certain page to be displayed everyday. I'm away from my computer a lot but I would like the news section of my website to have a new page everyday. Perhaps if I could write the sequence 7 days ahead, 1 for everyday of the week.

I'm guessing this could be done by PHP. If anyone knows how to do it and can share the code, please let me know!

- Thanks guys
__________________
Soft Hardware
OS Windows Media Center Edition 2005
Case Aspire X-Dreamer II
CPU Intel Pentium 4 3.2GHz Prescott 1MB L2-Cache
RAM Patriot Extreme Performance 2048 MB
Video Card Nvidia GeForce 6600 GT 128MB AGP8X
Hard Drive 80 Gigabyte Western Digital
Cooling System 1 - 120mm, 3 - 80mm, 3 - 40mm
CRT Moniter CTX VL700 Series [17" CRT] 1024 x 768 @ 75 Hertz
Power Supply Antec 420w
Disk Drives HP DVD-RW w/ Lightscribe Technology, HP CD-RW, and 3 1/2inch Floppy.
GARETH86B's Avatar
Computer Specs
Senior Member with 147 posts.
 
Join Date: May 2003
Location: UK
Experience: Advanced
12-Sep-2006, 02:28 PM #2
theres a javascript way of redirecting people depending on the day of the week, not quite sure its it exatly what you want but take a look

http://javascript.internet.com/navig...direction.html

or load a page depending of the day of the month

http://javascript.internet.com/navig...direction.html
__________________
Please click here and make a donation to help keep this great site available to all who need it. 100% goes directly to this site.

Last edited by GARETH86B : 12-Sep-2006 02:34 PM.
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
12-Sep-2006, 04:30 PM #3
I think this should do you want
PHP Code:
<?php
switch(date('N'))
{
case 
1:
echo 
'monday';
break;
case 
2:
echo 
'tuesday';
break;
}
?>
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
12-Sep-2006, 11:57 PM #4
Thanks guys,

Just wondering though for the PHP code where would I insert the source for the certain page I want it to display?
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
12-Sep-2006, 11:59 PM #5
PHP Code:
<?php

switch(date('N'))
{
case 
1:
include 
'monday.php';
break;
case 
2:
include 
'tuesday.php';
break;
}

?>
etc...
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
13-Sep-2006, 12:17 AM #6
oh alright thank you for going a little bit further with that covert.

Thanks again guys.

And covert I would like to appologize for the way I treated you in my last post. I suppose I was just to eager for help. My website is undergoing some major construction and we are on a deadline for some projects so I was a little to eager. But I wanted to take time to say I'm sorry for the way I acted.
__________________
Soft Hardware
OS Windows Media Center Edition 2005
Case Aspire X-Dreamer II
CPU Intel Pentium 4 3.2GHz Prescott 1MB L2-Cache
RAM Patriot Extreme Performance 2048 MB
Video Card Nvidia GeForce 6600 GT 128MB AGP8X
Hard Drive 80 Gigabyte Western Digital
Cooling System 1 - 120mm, 3 - 80mm, 3 - 40mm
CRT Moniter CTX VL700 Series [17" CRT] 1024 x 768 @ 75 Hertz
Power Supply Antec 420w
Disk Drives HP DVD-RW w/ Lightscribe Technology, HP CD-RW, and 3 1/2inch Floppy.
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
13-Sep-2006, 12:44 PM #7
hmm, well I gave it a go, but it didn't work.

Could it be because the part of my page I wanted it to go to was already php?
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
13-Sep-2006, 04:00 PM #8
What version of PHP are you using?
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
13-Sep-2006, 04:02 PM #9
here is the php manual explaining how to use the include() function

http://us3.php.net/include/
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
13-Sep-2006, 06:58 PM #10
Hmm alright, I think I understand a little better but I'm still somewhat confused why it still doesn't work.

Am I supposed to copy the code exactly as posted above or should I add something with the include function?

I set it up like this for my website

Code:
<?php

switch(date('N'))
{
case 1:
include 'sept132006.php';
break;
case 2:
include 'sept142006.php';
break;
}

?>
I'm not sure if thats correct though.

I just had a premade page that all it had was an image and some text that I inserted in a php file. Then I gave it the directory to that file within the script you gave me which is what I showed you in the code above... But like I said maybe I did it wrong.
__________________
Soft Hardware
OS Windows Media Center Edition 2005
Case Aspire X-Dreamer II
CPU Intel Pentium 4 3.2GHz Prescott 1MB L2-Cache
RAM Patriot Extreme Performance 2048 MB
Video Card Nvidia GeForce 6600 GT 128MB AGP8X
Hard Drive 80 Gigabyte Western Digital
Cooling System 1 - 120mm, 3 - 80mm, 3 - 40mm
CRT Moniter CTX VL700 Series [17" CRT] 1024 x 768 @ 75 Hertz
Power Supply Antec 420w
Disk Drives HP DVD-RW w/ Lightscribe Technology, HP CD-RW, and 3 1/2inch Floppy.
covert215's Avatar
Account Disabled with 2,651 posts.
 
Join Date: Apr 2006
Experience: Web Designer
13-Sep-2006, 07:30 PM #11
It just hit me why this didn't work. Today is Wednesday. You need to have a case 3 for today to show up. Case 1 is Monday, Case 2 is Tuesday, etc.
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
13-Sep-2006, 08:20 PM #12
Omg haha let me go try and see if it works.
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
13-Sep-2006, 08:34 PM #13
Darn. Well I tried. Here is what the code looked like:

Code:
<?php
switch(date('N'))
{
case 1:
echo 'monday';
break;
case 2:
echo 'tuesday';
break;
case 3:
echo 'news/svntb.php';
break;
}
?>
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
13-Sep-2006, 08:40 PM #14
Quote:
Originally Posted by brendandonhu
What version of PHP are you using?
The Infinity's Avatar
Senior Member with 575 posts.
 
Join Date: May 2005
Location: Florida
Experience: Advanced
13-Sep-2006, 10:13 PM #15
Oh sorry about that Bredan, I forgot to answer that.

How can I find out which version of PHP it is?
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:44 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.