Forum Moderators: martinibuster
I have a site which has around 200 static HTML pages. I use adsense in all these pages. The problem is , If I want to change the color or style of the ads, I have to modify all the 200 html pages. To avoid this I am planning to put the adsense code in an external file and include that file from the 200 HTML pages by using Java Script. I don't know exactly how to do it. Please help me out.
Server Side includes are OK (if your host supports them).
To use PHP wouldn't you have to convert all your .html pages to .php, which would be a pain.
I'm still running Adsense from Javascript files on some pages. So far either they haven't noticed or they don't mind. I'm not sure which!
The Javascript file is just a series of "document.write" statements that spit out the AdSense code. Easy to do, but if it is against the TOS, you're taking a risk.
To use PHP wouldn't you have to convert all your .html pages to .php, which would be a pain.
However... it's easier to do the following...
Thanks for your help. How can I parse HTML pages to PHP. Is there any freeware for this?
Add the following to your .htaccess file in the root dir of your website.... assuming your are on a *nix box.
They are typically hidden... so try & download it first via ftp to make sure you aren't writing over an existing .htaccess file w/ needed settings:
AddType application/x-httpd-php .html
AddHandler x-httpd-php .html
If you want more info... it's most likely already been covered.
[webmasterworld.com...]
[webmasterworld.com...]
[webmasterworld.com...]