homepage Welcome to WebmasterWorld Guest from 54.234.147.84
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
need help displaying daily content
leliphent




msg:702170
 3:41 pm on Jul 27, 2004 (gmt 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.

 

korkus2000




msg:702171
 5:25 pm on Jul 27, 2004 (gmt 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?

macrost




msg:702172
 6:27 pm on Jul 27, 2004 (gmt 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/>

leliphent




msg:702173
 7:26 pm on Jul 27, 2004 (gmt 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.

Jumper Willow




msg:702174
 9:03 pm on Jul 27, 2004 (gmt 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';

?>

alain_bonaf




msg:702175
 7:18 pm on Aug 4, 2004 (gmt 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>

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved