Welcome to WebmasterWorld Guest from 54.234.63.220

Forum Moderators: httpwebwitch

Message Too Old, No Replies

need help displaying daily content

     
3:41 pm on Jul 27, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 29, 2004
posts:91
votes: 0


Hey anyone,
I am looking to have the content within an Html document change daily. For this site I have a series of articles and I would like to have a different one display everyday. Can someone quickly tell me how to set that up?
PLeas and thank you.
L.
5:25 pm on July 27, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member korkus2000 is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 20, 2002
posts:3732
votes: 0


Welcome to WebmasterWorld leliphent,

It would be best achieved using a server-side language like PHP or ASP. Which can you use on your server?

6:27 pm on July 27, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Feb 27, 2003
posts:637
votes: 0


korkus,
Welcome to WebmasterWorld leliphent!

Well if this is an xml question, then leliphent can use javascript to pull xml files on a daily basis. Would take some programming, and if I remember right that it only works in IE, well it <lost train of thought/>

7:26 pm on July 27, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 29, 2004
posts:91
votes: 0


well, I was thinking of using an <Iframe> to display thew information, but I was hoping there was some meta refresh tag that would do it. Do you supose that having a refresh set for how many seconds in a day on each page directed to another page would work?
....sidetraking.....>>> that wouldn't work due to the initial page setting, in which one would need to keep the page open that full duration of time. See the script below rotates text, but its a pain to put a 12 page article in the script...I keep breaking it.

<SCRIPT LANGUAGE="JavaScript">
// Courtesy of SimplytheBest.net (http://simplythebest.net/info/dhtml_scripts.html)
<!--
document.write("<font color=#000000 size=2 face=Arial, Helvetica, sans-serif>")
now = new Date()
if (now.getDay() == 5)
document.write("It's Friday, Have you gotten your pay check yet?")
if (now.getDay() == 6)
document.write("It's Saturday, time to relax and surf through this site!")
if (now.getDay() == 0)
document.write("It's Sunday, the Day of Rest.")
if (now.getDay() == 1)
document.write("It's Monday, take it easy, don't get frustrated.")
if (now.getDay() == 2)
document.write("It's Tuesday, for some reason I think of Philly.")
if (now.getDay() == 3)
document.write("It's Wednesday, the middle of the week, perhaps a drink later?")

if (now.getDay() == 4)
document.write("It's Thursday, another drink!")

document.write("</font>")
//-->
</script>

I have another script also that rotates images below, I am wondering if I can get it to rotate pages, I tried an <A Href> tag, but this did not work. Any thoughts?

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source! [javascript.internet.com...] -->

<!-- Begin
today = new Date();
day = today.getDay();
arday = new Array("sunday.jpg", "monday.jpg", "tuesday.jpg",
"wednesday.jpg", "thursday.jpg", "friday.jpg", "saturday.jpg");

document.write("<img src='" + arday[day] + "'>");
// End -->
</script>

PLease take a look and let me know if there is anything I can do.
L.

9:03 pm on July 27, 2004 (gmt 0)

New User

10+ Year Member

joined:July 27, 2004
posts:15
votes: 0


I'm not too familiar with javascript, but here is a solution using PHP.


<?
$today = date("D");

if($today == "Sun")
include 'sunday.ext';

else if($today == "Mon")
include 'monday.ext';

else if($today == "Tue")
include 'tuesday.ext';

else if($today == "Wed")
include 'wednesday.ext';

else if($today == "Thu")
include 'thursday.ext';

else if($today == "Fri")
include 'friday.ext';

else if($today == "Sat")
include 'saturday.ext';

?>

7:18 pm on Aug 4, 2004 (gmt 0)

Junior Member

joined:Aug 3, 2004
posts:64
votes: 0


Have done something like this for our site, have to adapt to your specific case of course. The function must be called by the container of iframe not inside the child document

<script>
function Change_iframe(number,date)
{
argument_local = '?' + 'date' + '=' + date;

try
{
document.getElementById('iframe').src='mydoc' + '_' + date + '/' + 'mydoc.html' + argument_local;
}
catch(er) {

}
}

</script>

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members