Hi, I want to add some code which is in HTML on all of the pages in my website, the only problem is when I change something in that code it'll mean that I have to change the code on every page, what I want to do is put the code in one file and then tell the HTML to read that code, I know about the <script> tags but you can only put them in the head, this code has to go in a cell of a table so it needs to be in the body. Can anyone help me Thank you
In my limited knowledge of coding practices, it sounds like you need a PHP include or something similar.
There are several ways to do that. - Using SSI (Server Side Includes) on server side - Using a program to make your HTML on server side (PHP, PERL, ...) - Using AJAX on client side to refresh that cell - Using an IFRAME on your html as the content of that cell - ... If the change is on a table cell probably your best option is with IFRAME.
I would highly recommend using PHP if this is a fairly large website. You'll be happy that you did. If you have less than a couple dozen pages, it is probably easier to just insert the extra code on every html page. (Easier if you don't have much knowledge of PHP like myself).
I suggest you read this post I wrote last year on the subject. Regardless of whether you know how to use PHP includes or Server Side Includes (SSI) you'll be able to learn enough to use them on your Web site (consider this to be the ultimate authority on PHP includes and SSI). http://forums.digitalpoint.com/showthread.php?p=2145250#post2145250