•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,554 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,429 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3816 | Replies: 13
![]() |
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
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
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 240
php Syntax (Toggle Plain Text)
<?php $arr=array(); for($i=0;$i<7;$i++){ $arr[$i]="./img/images/".$i.".jpg"; //assigning the image location to the array $arr. } $random=rand(0,6); //generating a random number echo "<img src=".$arr[$random].">"; //printing the image ?>
Thats it
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Random Images on Refresh (JavaScript / DHTML / AJAX)
- random images (PHP)
- Implementing Random Images (Java)
- Need help making simple random images (PHP)
- ASP .NET Display Random records from the database (ASP.NET)
- looking for a free or low cost program to randomly display text and/or images (PHP)
Other Threads in the PHP Forum
- Previous Thread: dynamically built webpage for multiple audio and text points.
- Next Thread: PHP Count & Display Question



Linear Mode