November 8th, 2012, 05:29 PM
Edit HTML file with PHP dynamically adding new html/links every night
I have got some batch scripts what makes timelapse videos at the end of every day and names them like "Timelapse_dd_mm_yyyy.mp4".
I now want to edit a basic and static html file automatically every night and add/append some html code on a certain line for a link to the latest time lapse video.
So every night the html files grows slightly larger.
How do I do this with PHP so it adds the relevant html code for the time lapse video at a certain time every night. The HTML content also needs to have the current file names of all the videos.
So for example, the following links would be added as so.
Time lapse 01/12/12 (Click to download) - Would be added on the first of December
Time lapse 02/12/12 (Click to download) - Would be added on the second of December
Time lapse 03/12/12 (Click to download) - Would be added on the third of December
Finally videos would be in "/time_lapse_videos" and html file would be in current directory
November 8th, 2012, 06:14 PM
Do it the normal way: make PHP be the thing which outputs this HTML, then you can have it do whatever it wants without having to try to modify existing files or anything complicated like that.
November 9th, 2012, 02:35 PM
So what you're saying is that you want a static HTML file that's not actually static.
A page that changes, by definition is dynamic not static.