Random Ads
First of all, create a file call random.php
PHP Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
// load the file that contain the ads
$adfile = "ads.txt";
$ads = array();
// one line per ad
$fh = fopen($adfile, "r");
while(!feof($fh)) {
$line = fgets($fh, 10240);
$line = trim($line);
if($line != "") {
$ads[] = $line;
}
}
// randomly pick an ad
$num = count($ads);
$idx = rand(0, $num-1);
echo $ads[$idx];
?>
everything is explained line per line
then create a txt file and call it ads.txt
Code
<a href="http://www." target="_blank"><img src="http://" width="468" height="60" border="0"></a>
<a href="http://www.">some ad</a>
<a href="http://www.">some more ad</a>
you can modify this as you want, i hope you just have a little knowledge of HTML...
then insert the following code in your page to display it
Code
<iframe marginwidth="0" marginheight="0" width="468" height="60" scrolling="no" frameborder=0 src="randomad.php">
</iframe>
you can also modify this as you want...
for other features dont border to pm me ^^