Click to See Complete Forum and Search --> : Insert text from external file


mleach82
09-17-2008, 11:54 AM
Im not sure if this is possible but i wanted to ask anyway.

My company's website contains pages which display our current updates for our software as well as the newest EXE date of our software. There are currently about 5 pages that contain this EXE date.

Whenever that date changes, i go to all 5 pages, change the date and re-upload. Is there any way to create a blank htm file that contains this date and have the 5 pages pull the date from that file?

I know this is a possibility in Frontpage using substitutions but im current using Expression Web and the only way to use substitutions is in ASPX pages which i have no knowledge in.

Any help would be appreciated, thanks.

BonRouge
09-17-2008, 12:08 PM
http://bonrouge.com/~faq#includes

mleach82
09-17-2008, 12:17 PM
Forgive my ignorance but my knowledge is limited to basic HTML. How would i setup such a task using PHP?

mleach82
09-17-2008, 01:12 PM
So im getting somewhere with this. After doing some searching ive found i was able to do this with JavaScript. Here is what i have:

In the <head> i have entered this:
<script type="text/javascript" src="../../../Templates/javascript/exedate.js"></script>

The exedate.js contains this:
var exedate = 09172008

And where it needs to be displayed i have this:
<script type="text/javascript">document.write(exedate);</script>

This all works but i have one question. How can i display the date using slashes to separate the month day and year? If i ever the slashes with the date it appears to divide the 3 numbers and gives me a -2096 instead of the date.

Thanks

BonRouge
09-17-2008, 01:20 PM
I think the information you want about php is in the link. Which part of it do you not understand?

As for your javascript question, you can put the number (with the slashes) in quotes - it then becomes a string rather than a number.

mleach82
09-17-2008, 01:23 PM
Thank you very much for your help, the quotes worked.