Hi guys, i came across a script which randomally changes between images for use on bulletin boards such as this one. Instead of placing a satic image in your sig you can place the url to this script between img tags and a different image appears on each page load.

Terrific!

The only issue i have is that i can't figure out how to make each image linkable to a URL. Any ideas on how to resolve this?

<?php
header("Content-type: image/jpeg");
$number = rand(1,2);

if ($number == 1) {
$im = imagecreatefromjpeg("http://img330.imageshack.us/img330/7020/blaaug3.jpg");
imagejpeg($im);
}
elseif ($number == 2) {
$im = imagecreatefromjpeg("http://img330.imageshack.us/img330/7020/blaaug3.jpg");
imagejpeg($im);
}

?> 

You can of course just use an simple array but the GD Lib needs to used to render the images...

    Use the string to push the actual HTML code. The PHP would simply be the random picker of strings.

    Each string is the URL of an image then formulate the <img src... /> from the string that PHP picks.

    In turn you could add the anchor tag to add a link to the image.

    In other words, push the HTML to the page. The HTML is where you add the link.

    LOL, hope this helps :rolleyes:

      Write a Reply...