Im newb to PHP so yehPHP Code:<?php // Start PHP so the server knows to parse anything below this as PHP
$ads = array(); // Start an array
$ads[] = '<a href="http://www.domain.com"><img src="/banners/ad1.gif" alt="domain's banner" /></a>';
// We have created our first ad. We simple just put the format of the ad within an $ads[] variable. We can add as many ad's as we want as it is an array and won't overwrite the variable.
$ads[] = '<a href="http://www.domain2.com"><img src="/banners/ad2.gif" alt="domain2's banner" /></a>';
//We have no added another. Now we will display the ad's.
shuffle($ads);
// We will use the PHP function shuffle to randomise our advertisements.
echo $ads[0];
// We echo the first ad in the array. The array has been shuffled so the first ad will change.
?> //Stop parsing as PHP
you have now created your ad's





Reply With Quote


