Forum Moderators: open

Message Too Old, No Replies

change html by server date and time?

         

mstevenson

3:09 pm on May 19, 2006 (gmt 0)

10+ Year Member



I am trying to automate our specials a little bit more, currently I have to manually upload the main special pages at the beginning of the month (index.html, some service pages, and a few images). By the end of the month, I have to go in at midnight and overwrite the pages and images with new files that say "Last Week", "3 Days Left". "2 Days Left", and "Last Day". I then have to remove the special on the last day (all manually).

I just tried looking for some sort of script or some server side program that would let me automate this, but couldn't find anything. Our server is a linux server, and I can use php, cgi/perl, js, etc... Does anyone know of a program or script that would help me automate this process? I posted this in the JavaScript and AJAX forum because I figured js would be the best way to do this, but please let me know if it's not.

Fotiman

3:23 pm on May 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



JavaScript would run client side. What you want is something server side to generate dynamic content based on the date. PHP would be your best bet, given what's available to you.

mstevenson

3:34 pm on May 19, 2006 (gmt 0)

10+ Year Member



the more I think about it, what would be perfect is maybe a perl script and cron job that would check the server time and if there is (for example) a folder named something specific, to move the content to the www directory to overwrite the existing files. Could name the folder the date, and have it check for a match or something. At any rate, I will probably go re-post in a different forum as this is probably not the right place to discuss cron and perl...

mstevenson

3:45 pm on May 19, 2006 (gmt 0)

10+ Year Member



I started a different thread in the server side/perl forum:

[webmasterworld.com...]