display random images from folder

Reply

Join Date: Oct 2007
Posts: 19
Reputation: tryphy is an unknown quantity at this point 
Solved Threads: 0
tryphy's Avatar
tryphy tryphy is offline Offline
Newbie Poster

display random images from folder

 
0
  #1
Oct 18th, 2007
Hi guys...

I want some help of how to call images from a folder....
Its like..v have a folder called images and it has many images in it.....but i need only 6 images to display in a php webpage...when the webpage is reloaded, it displays another images...its like its displaying random images.....But in one page, i would like to display only 6 images....So, when the reload or visit again, the images or randomised from the images folder.....can any one know how can it be done....
I m not sure abt the codes...


Thanks
Tryphy
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,226
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: display random images from folder

 
0
  #2
Oct 18th, 2007
ok sounds pretty easy. how do you want the images displayed on the page? in a table?
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 19
Reputation: tryphy is an unknown quantity at this point 
Solved Threads: 0
tryphy's Avatar
tryphy tryphy is offline Offline
Newbie Poster

Re: display random images from folder

 
0
  #3
Oct 19th, 2007
Originally Posted by kkeith29 View Post
ok sounds pretty easy. how do you want the images displayed on the page? in a table?

Ya..in a table like in one row got 2 images...
so 3 rows and 2 columns...
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,226
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: display random images from folder

 
0
  #4
Oct 19th, 2007
almost done, will post in a little while
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 19
Reputation: tryphy is an unknown quantity at this point 
Solved Threads: 0
tryphy's Avatar
tryphy tryphy is offline Offline
Newbie Poster

Re: display random images from folder

 
0
  #5
Oct 19th, 2007
Thanks...
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,226
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: display random images from folder

 
0
  #6
Oct 20th, 2007
finished the code; i sent you a private message with the url of the test script
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 271
Reputation: fatihpiristine has a little shameless behaviour in the past 
Solved Threads: 16
fatihpiristine's Avatar
fatihpiristine fatihpiristine is offline Offline
Posting Whiz in Training

Re: display random images from folder

 
0
  #7
Oct 21st, 2007
i posted exactly same one as you want 3 days ago.
Do a favour, leave me alone
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 2
Reputation: ezykiwi is an unknown quantity at this point 
Solved Threads: 0
ezykiwi ezykiwi is offline Offline
Newbie Poster

Re: display random images from folder

 
0
  #8
Dec 9th, 2007
Im new to the forums here but was just wondering if there is any chance of being able to look at the code? im looking for something similar to this but all the examples i have found online are for only displaying 1 random image at time...

Cheers Ezy
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,737
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 329
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: display random images from folder

 
0
  #9
Dec 10th, 2007
  1. <?php
  2. $arr=array();
  3. for($i=0;$i<7;$i++){
  4. $arr[$i]="./img/images/".$i.".jpg"; //assigning the image location to the array $arr.
  5. }
  6. $random=rand(0,6); //generating a random number
  7. echo "<img src=".$arr[$random].">";
  8. //printing the image
  9. ?>

Thats it
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,226
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: display random images from folder

 
0
  #10
Dec 10th, 2007
i think ezykiwi wanted to display more than one image. your code only displays one random image.
Reply With Quote Quick reply to this message  
Reply

Tags
image, random

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC