Log In · Register

 
Random Image Everytime You Refresh
Keeper-Of-Keys
post Jul 2 2009, 09:24 PM
Post #1


Member
**

Group: Member
Posts: 27
Joined: Sep 2008
Member No: 685,562



I have a Piczo website and I wish to place a html code for displaying random images everytime I refresh my page. How do you do this?
 
 
Start new topic
Replies
newkidontheblock
post Jul 3 2009, 07:22 AM
Post #2


Offline.
*****

Group: Official Designer
Posts: 609
Joined: Mar 2007
Member No: 507,591



If you don't want to use javascript for that you can use php which is better.

Here is the simpliest way that I could thing ok.

Must be a .PHP File
CODE
<?php
// linking to the images that you want to display.
// feel free to edit within the single quotes ''
$images = array(
'http://farm1.static.flickr.com/175/428230889_3b3994a0b9_m.jpg',
'http://farm2.static.flickr.com/1371/1008816651_22d46ee2d1_m.jpg',
'http://farm4.static.flickr.com/3121/2765637403_268188b4a7_m.jpg',
'http://farm4.static.flickr.com/3008/2611822886_ee757ee4ed_m.jpg',
'http://farm1.static.flickr.com/1/2998240_18286b2677_m.jpg'

);

// printing out the image.
echo "<img src=\"" . $images[array_rand($images)] . "\" alt=\"\" />";
?>


You can add as many images as you want.
Make sure you add the comma , after all except the last one.

Edit: I don't no if Piczo allow php.
 

Posts in this topic


Closed TopicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: