PDA

View Full Version : Text from one page to display in others HTML style


Death Dream
11-25-2008, 06:28 PM
I know the PHP code on how to pull data from one page and pull it into another and it is really simple process to do. But I need to be able to do it in HTML code for several reasons but would rather not go into it.

Over at one of the sites I mantain http://adesadesmoines.com/ you can see the "Update" time at the top of the page. That is done by just editing the index.html page and then saving it and so on.

What I want to do is make a .txt or another .html file with just the date "11/25 ap 2:00pm" and have that pulled into the index page. I'm going to have the updated time displayed on multiple pages but don't want to have to edit every page. Any idea how I could do with with just standard HTML or Java?

I don't want to change file extensions because many people bookmark this site. and .asp files can't get changed to .php

~Death Dream~

coloeagle
11-25-2008, 08:35 PM
With JS just add the following on each of the pages you want to display the update info. This script will automatically insert the date and time the page was updated.

Last Updated: <script type="text/javascript">
//<![CDATA[
<!--//
document.write(document.lastModified);
//-->
//]]>
</script>

Death Dream
11-25-2008, 09:39 PM
Is there a way I can make that update based off a .CSV file? Because the only file that is changing is a spreadsheet file and if I can get that to just update by that, that would be even better.

No real content changes on the main page so just tossing that in there wont work.

~Death Dream~

coloeagle
11-25-2008, 10:12 PM
Is there a way I can make that update based off a .CSV file?
Sorry, I don't know if this can be done.

Another option would be to have the update info saved as a .js file using the document write.
document.write('Updated 11/25 2:00pm');
On each page,
<script type="text/javascript" src="update.js"></script>

Death Dream
11-26-2008, 04:13 AM
I'll give that a try!

~Death Dream~

Rob_Che
11-26-2008, 11:13 AM
<script type="text/javascript" src="update.js"></script>

That's a nice solution coloeagle !

Death Dream
11-26-2008, 03:54 PM
Thanks! That did exactly what I wanted!

~Death Dream~