I am confidant that you can do this with SSI or PHP (or perl,python,cgi,etc...). If you are willing to do that, you can do a google search for
apache standard footer and the
last result on the first page should provide a basic walkthrough for SSI.
If you want to do it without that stuff, you may be out of luck.