Can I use one line of php that calls a block of Google ads from a php document on an html page? If so, what do I put in the .htaccess doc to do this? Any help would be appreciated!
Sorry but... can you be more specific? Do you want to parse a PHP page (not on your server?) and get the Google ads from this site and display them on one HTML page of yours? Whatever you're trying to do, it's probably against Google's TOS.
I want to call a php document that has my Google Adsense code into an html document. Everything is on my server. My extensions on my pages are htm Yes, I think I want php includes. Just not sure how to do it. I have a php example. I just don't know how to implement it into my htm page. Do I have to rename all of my pages to have php extension?
rename the htm to php and do this where u want to have the ads: include("googleads.php"); of course replace the googleads with the page where the google ad code is
if you cannot rename all your .htm to php then use iframe,, it might work ok. you can disable its scrolling,frameborder etc..
In your .htaccess, add: AddType application/x-httpd-php .php .htm .html In your .html pages: <?php include 'google_ads.php'; ?> Where google_ads.php contains the adsense code. But that is not the best way to do it... but it seems you already have a site filled with static content.
Thanks everyone for taking the time to reply to my questions. KRT, What is the best way to do this, then?
sorry, i was wrong to prefer iframes, because by putting adsense in an iframe, it cannot search content of site, as there is hell of difference between php include and iframe. so, you should rename all your files to .php and link them together and use include. here is what google replies regarding this issue. so, put your ads in file like google_ads.php and then include them on all of your pages in ads block using this tag: <? include("path/google_ads.php");?>