Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/blackst/public_html/tutorials/buttonrotation.php on line 1
Warning: include(http://black-stripes.net/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/blackst/public_html/tutorials/buttonrotation.php on line 1
Warning: include() [function.include]: Failed opening 'http://black-stripes.net/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blackst/public_html/tutorials/buttonrotation.php on line 1
Button Rotation
When you for example have a advertising section on your site, you want the advertisers' buttons to rotate, so they change when you're navigation though your site. This is quite easy to do, and I'll show you how!
1. Paste this where you want the ads to appear;
<style type="text/css">
</STYLE><SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var how_many_ads = 3;
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;
if (ad==1) {
url="siteurl";
alt="Alt Text";
banner="buttonurl";
width="88";
height="31";
}
if (ad==2) {
url="siteurl";
alt="Alt Text";
banner="button url";
width="88";
height="31";
}
if (ad==3) {
url="siteurl";
alt="Alt Text";
banner="buttonurl";
width="88";
height="31";
}
document.write('<a href=\"' + url + '\" target=\"_blank\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0></a>');
// End -->
</SCRIPT>
2. Paste siteurl and buttonurl to each site, and remember to change the size if it's different than what the code says You can add several buttons, just copy one of the codes and change if (ad=3) { as you go.
Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/blackst/public_html/tutorials/buttonrotation.php on line 48
Warning: include(http://black-stripes.net/footer.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/blackst/public_html/tutorials/buttonrotation.php on line 48
Warning: include() [function.include]: Failed opening 'http://black-stripes.net/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blackst/public_html/tutorials/buttonrotation.php on line 48