| DNOA Member Location: Milford MA Join Date: Oct 2005
Posts: 682
NP$: 94.45 ( Donate)
| I prefer flatDB for this.
In your DB file, put: Code: http://www.hi.com||http://www.hi.com/hi.png
http://www.hi2.com||http://www.hi2.com/hi.png
The php: PHP Code: <?
funtion ad_template($url, $img){
$ad = "<a href='".$url."'><img src='".$img."' alt=''/>";
return $ad;
}
$i = 0;
$lines = file('addb.txt');
foreach($lines as $line){
$i++;
$data = explode("||", $line);
$return[$i] = ad_template($data[0], $data[1]);
}
$number = rand(0,$i);
echo $return[$number];
?> |