PHP Append to bottom of HTML of all HTML Files in all Sub Folders?
Posted on 25 May 2010 by Abidoon
Hello,
I am trying to find a way to save some time. I need to write a php script that adds a small footer to the bottom of about 300 HTML Pages. If I did this manually, it would be painful. I was wondering if anyone could help with a PHP Script that adds the line to the bottom of all HTML Pages in about 200 sub folders?

You should have made your pages dynamic. Here is a link with the function you need to append content to existing pages.
http://www.php.net/manual/en/function.file-put-contents.php
You should use “include” from now on. If you don’t know what include is or does send me an email and I’ll be glad to tell you. Your pages have to be saved with the extension .php and not .html to use include. They don’t have to be saved like that to use the function in the link however.
What include basically does is it includes a file you specify in any page you specify it, where ever you specify it in that page. You should use this if you have the same footer in every page for example, or the same banner and/or menu.