I just wondering what's the best code to link a ad link to my website, because I need to update my ad very often, by doing this, I don't have to update every single pages
use include(); use this on every page that you want the ads to show: include('ads.html'); When you want to edit the links, just edit ads.html - ads2help
So, how have you implemented it? In the .php-file, for example index.php, you will place the include ('ads.html'); wherever you'd like the ads to show up. Note that the ads.html-file need to contain the exact presentational code to show the ads as you want. For instace, if the ad is in a javascript/iframe, just put the ad-code in the ads.html, do not put anything else there. The include()-function just takes whatever is in the file you link and puts it in the page where the include()-function is placed, so it's bascially the same as if you put the ad-code directly into the file, except that you won't have to update more than ads.html for changes to take effect.
<?php include ('http://www.mywebsite.com/myad.html');?> is this is the right code, my website is mixed with html, and some java this is how I start my code </head> <body bgcolor="#000000" text="#000000"> <div id="bv_" style="position:absolute; left:6px; top:12px; width:243px; height:150px; z-index:0" align="left"> <?php include ('http://www.mywebsite.com/myad.html');?> <font size="5"> but it just won't display that ad or maybe cause my site is end with html? because I cant change all to .php now, I have too many pages
If the page is a .html file, it won't by default display php-code, no. You can, however, parse .html through php by editing your .htaccess-file. add this: AddType application/x-httpd-php .html
If the myad.html is located at same directory as your file, use this instead include ('myad.html'); Don't use http://www.mywebsite.com/ inside. - ads2help
no, you add it to your .htaccess file. For information on .htaccess: http://www.webhostingresourcekit.com/256.html http://en.wikipedia.org/wiki/Htaccess
1. Use relative path in your include, without http:// 2. Remove UTF BOM because it could break browser's rendering. (For example, if under Windows, re-save file with Notepad2 without "Signature")