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: 4130061" data-attributes="member: 56284"><p><strong>Display a different image for each day of the week</strong></p><p></p><p> <strong>Description</strong></p><p></p><p> This PHP script will get the day of the week from the server date and then display an image (jpg or gif) to match.</p><p> <strong>The code</strong></p><p></p><p> [PHP]<?php</p><p></p><p></p><p></p><p>/**</p><p></p><p> * Change the name of the image folder</p><p></p><p> *</p><p></p><p> * Images must be named Monday.gif, Tuesday.gif etc</p><p></p><p> */</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/days";</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>$today = date('l');</p><p></p><p></p><p></p><p>if (file_exists($image_folder."/".$today.".gif")) {</p><p></p><p> echo "<img src=\"$image_folder/".$today.".gif\">";</p><p></p><p>}</p><p></p><p>else {</p><p></p><p> echo "No image was found for $today";</p><p></p><p>}</p><p></p><p></p><p></p><p>?> </p><p></p><p>[/PHP]</p></blockquote><p></p>
[QUOTE="MaD-DoC, post: 4130061, member: 56284"] [B]Display a different image for each day of the week[/B] [B]Description[/B] This PHP script will get the day of the week from the server date and then display an image (jpg or gif) to match. [B]The code[/B] [PHP]<?php /** * Change the name of the image folder * * Images must be named Monday.gif, Tuesday.gif etc */ // Change to the location of the folder containing the images $image_folder = "images/days"; // You do not need to edit below this line $today = date('l'); if (file_exists($image_folder."/".$today.".gif")) { echo "<img src=\"$image_folder/".$today.".gif\">"; } else { echo "No image was found for $today"; } ?> [/PHP] [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom