Total members 11841 |It is currently Sat Jan 16, 2021 4:25 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





This PHP script will get the day of the week from the server date and then display an image (jpg or gif) to match.

Code:
<?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";
}
?>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Display a different image for each day of the week
 get week day name or month name     -  
 Image-Viewer-Image Processing-Filters-Noise-enhancements     -  
 Here is how to display any 2d array     -  
 SEVEN SEGMENT DISPLAY     -  
 display list     -  
 Move image in front of a background image     -  
 Display images on jsp from servlet     -  
 Can I display same vertically on right side?     -  
 How can i display these items in Listview in C#?     -  
 display code block using html     -  



Topic Tags

PHP Date
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com