PDA

View Full Version : Rotating Banner Script


fanfwar
12-01-2004, 01:24 AM
Anyone have any rotating banner scripts that they use or know about. The simpler the better. :)

Lene
12-01-2004, 02:47 AM
The simpler the better.. mm, I have seen a really simple code in another forum,
if I can find it again. Depends on how simple you want it.

I use phpmyadsnew for one of my sites, but that is not simple, though very good.
Didn't have time to play with it too much yet.

fanfwar
12-01-2004, 12:31 PM
Thanks for the PM i will try phpmyadsnew to begin with , i have time to work it out if its technical.

:)

Script-Auction
12-01-2004, 09:34 PM
Try this:
http://www.free-php-scripts.net/fps_banner_manager.php

Very easy to use.

spider2005
04-14-2005, 09:24 AM
Anyone have any rotating banner scripts that they use or know about. The simpler the better. :)

I recommend Phpadsnew http://www.phpadsnew.com . It looks complex at first but it is a very good banner management system. you can manage your banners properly in terms of impression, display schedule, size etc. This application which is an open source runs separately from your site. You only need to generate the Javascript codes and place these in your main site.

Adam
04-15-2005, 11:14 AM
You wanted simple, heres simple:

<?php
$File = 'stat.txt';

$Images[] = 'Banner1.gif';
$Images[] = 'Banner2.gif';
$Images[] = 'Banner3.gif';

$fp = fopen($File, 'r');
$Stat = fread($fp, filesize($File));
fclose($fp);

if($Stat >= count($Images)) $Stat = 0;

echo $Images[$Stat];
$Stat++;

$fp = fopen($File, 'w');
fwrite($fp, $Stat);
fclose($fp);

?>

Just call copy and paste that code into a PHP file edit the banner1.gif .. 3.gif to your images that your want to use. To add more all you have to do is copy this line:

$Images[] = 'Banner3.gif';

And repeat it below it, once you have done that. Make a txt file called stat.txt and just put the number 0 in it. Make sure you chmod the stat.txt file to 777. Whereever you want the banners to appear just use an include if its PHP:

include('banner.php');

or use an IP frame to include it. Sometimes you can use:

<?php include('banner.php'); ?>

And that will work in a HTML file sometimes, it depends on the server.

Hope this helps.


Adam

Wolf
04-15-2005, 01:29 PM
This script should be used like this <img src="<? include('banner.php'); ?>">
but I think it would be simplier if you use the function rand