Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Software Development
UseFul PHP Script`s n Code`s
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="MaD-DoC" data-source="post: 4130073" data-attributes="member: 56284"><p><strong>Random image</strong></p><p></p><p> <strong>Description</strong></p><p></p><p> Displays a random image on a web page. Images are selected from a folder of your choice.</p><p> <strong>The code</strong></p><p></p><p> [PHP]<?php</p><p></p><p></p><p></p><p>/*</p><p></p><p> * Name your images 1.jpg, 2.jpg etc.</p><p></p><p> *</p><p></p><p> * Add this line to your page where you want the images to </p><p></p><p> * appear: <?php include "randomimage.php"; ?></p><p></p><p> */ </p><p></p><p></p><p></p><p>// Change this to the total number of images in the folder</p><p></p><p>$total = "11";</p><p></p><p></p><p></p><p>// Change to the type of files to use eg. .jpg or .gif</p><p></p><p>$file_type = ".jpg";</p><p></p><p></p><p></p><p>// Change to the location of the folder containing the images</p><p></p><p>$image_folder = "images/random";</p><p></p><p></p><p></p><p>// You do not need to edit below this line</p><p></p><p></p><p></p><p>$start = "1";</p><p></p><p></p><p></p><p>$random = mt_rand($start, $total);</p><p></p><p></p><p></p><p>$image_name = $random . $file_type;</p><p></p><p></p><p></p><p>echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />";</p><p></p><p></p><p></p><p>?>[/PHP]<span style="color: #000000"></span></p><p><span style="color: #000000"></span></p></blockquote><p></p>
[QUOTE="MaD-DoC, post: 4130073, member: 56284"] [B]Random image[/B] [B]Description[/B] Displays a random image on a web page. Images are selected from a folder of your choice. [B]The code[/B] [PHP]<?php /* * Name your images 1.jpg, 2.jpg etc. * * Add this line to your page where you want the images to * appear: <?php include "randomimage.php"; ?> */ // Change this to the total number of images in the folder $total = "11"; // Change to the type of files to use eg. .jpg or .gif $file_type = ".jpg"; // Change to the location of the folder containing the images $image_folder = "images/random"; // You do not need to edit below this line $start = "1"; $random = mt_rand($start, $total); $image_name = $random . $file_type; echo "<img src=\"$image_folder/$image_name\" alt=\"$image_name\" />"; ?>[/PHP][COLOR=#000000] [/COLOR] [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom