Nu wil ik graag dat er een tekst verschijnt als je met de muis over de banner gaat.
En target blank krijg ik ook bij php niet voor elkaar.
Met html kan ik net wel, maar, wie weet hoe dit wel in php moet ?
Dit is het script waar het over gaat
<?php
class cAds
{
protected $_aAds = array();
public function addAd($sTitle, $sImage)
{
$this->_aAds[] = array(
"Title" => $sTitle,
"Image" => $sImage
);
return true;
}
public function showRandom()
{
$aAd = $this->_aAds[array_rand($this->_aAds)];
return '<a href="' . $aAd['Title'] . '"><img src="' . $aAd['Image'] . '" alt=""/></a> ';
}
}
?>
<?php
try
{
$oAds = new cAds;
// hier kan je de afbeeldingen in zetten
$oAds->addAd("http://www.aquashopdepijp.nl", "http://willemhartman.nl/bazar/linkpagina/banners/aquariumshopdepijp.gif");
$oAds->addAd("http://bazar.willemhartman.nl/aanvraagform_reclame.php", "http://willemhartman.nl/website/logo/adv.gif");
$oAds->addAd("http://www.garnalenenkreeftenforum.nl", "http://willemhartman.nl/website/logo/forum.GIF");
$oAds->addAd("http://aquariumreef.nl", "http://aquariumreef.nl/foto/aquariumreef_banner.gif");
echo $oAds->showRandom();
}
catch(Exception $e)
{
echo $e->getMessage();
}
?>
2.139 views