PhpCode
Posted: Mon Jun 30, 2014 10:18 am
Code: Select all
<?php
$total = "3";
// 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 = "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\" />";
?>
My question is if i run this code,in browser it just show the image name,not the image , what is the wrong with the code?? I want to show the images..