Home > Life > Blog Header Images

Blog Header Images

August 3rd, 2008

Tried to look at AMFPHP and by doing that I need to learn some basics in PHP. So with that I did a little image header swap for my blog. Did 4 small images.

The PHP looks like this.

// Change this to the total number of images in the folder
$total = "4";
// 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";
// You do not need to edit below this line
$start = "1";
$random = mt_rand($start, $total);
$image_name = $random . $file_type;
 
echo "<div id=\"header\" style=\"background-image: URL($image_folder/header-bg$image_name);background-repeat:no-repeat\">";

Life , , , ,

  1. No comments yet.
  1. No trackbacks yet.