Image and Link Rotation

Soldato
Joined
30 Apr 2007
Posts
3,095
Location
Kent
Hi Guys

I am designing a website, and I would like to have an image that uses a rotation similar to us with rotating signatures, now, I also want to link to details of the image.

Could a kind sole tell me if I can rotate an image and have the link change that the image will lead to when clicked?

If you could include the code, that would be brill.

Thanks.

Swinnie
 
A friend made me this as i wanted it for a website. Hope it helps

PHP:
<?php 
    $images = array(array( 
                                        'link' => 'http://www.****.co.uk', 
                                        'image' => 'http://****.co.uk/1.jpg'
                                    ), 
                                    array( 
                                        'link' => 'http://www.****.co.uk', 
                                        'image' => 'http://****.co.uk/2.jpg'
                                    ) ,
									array( 
                                        'link' => 'http://www.****.co.uk', 
                                        'image' => 'http://****.co.uk/3.jpg' 
                                    ) ,
									array( 
                                        'link' => 'http://www.****.co.uk', 
                                        'image' => 'http://****.co.uk/4.jpg'
                                    ) 
                                    ); 
    $image_count = count($images)-1; 
    $image = rand(0, $image_count); 
    echo '<a href="'.$images[$image]['link'].'"><img src="'.$images[$image]['image'].'" /></a>'; 
?>
 
Back
Top Bottom