php:main query
- onlyproductions
-
onlyproductions
- Member since: Oct. 30, 2005
- Offline.
-
- Forum Stats
- Member
- Level 11
- Blank Slate
in the random ad script in the php main the image does appear randomly but no link is attached to the image how can i fix this
.
- WoogieNoogie
-
WoogieNoogie
- Member since: Jun. 26, 2005
- Offline.
-
- Forum Stats
- Member
- Level 15
- Programmer
- onlyproductions
-
onlyproductions
- Member since: Oct. 30, 2005
- Offline.
-
- Forum Stats
- Member
- Level 11
- Blank Slate
k heres my code
<?php
$ads = array("http://www.bomtoons.com/downloads/bann ers/banner2.gif", "http://www.newgrounds.com/banners/BadReligio nSkater_2.gif");
$links = array("http://www.bomtoons.com", "http://www.newgrounds.com");
$total_ads = count($ads);
$pick_ad = rand(0, $total_ads-1);
echo '<img src="' . $ads[$pick_ad] . '">';
?>
.
- WoogieNoogie
-
WoogieNoogie
- Member since: Jun. 26, 2005
- Offline.
-
- Forum Stats
- Member
- Level 15
- Programmer
<?php
$ads = array("http://www.bomtoons.com/downloads/bann ers/banner2.gif", "http://www.newgrounds.com/banners/BadReligio nSkater_2.gif");
$links = array("http://www.bomtoons.com", "http://www.newgrounds.com");
$total_ads = count($ads);
$pick_ad = rand(0, $total_ads-1);
echo '<a href="' . $links[$pick_ad] . '"><img src="' . $ads[$pick_ad] . '"></a>';
?>
That should work with your current syntax.

