How to add links to this script...
Hello,
How can I add links to the images that get output from the following php code?
PHP Code:
<?php
$i=0;
$path="flags";
$ext = "png";
$extra= "alt=\"Random Image\" float=\"left\"";
if ($handle = opendir($path)) {
while (false !== ($file = readdir($handle))) {
if (substr($file,strlen($file)-3,3)==$ext)
{ $imgs[$i++]=$file;
}
}
closedir($handle);
$today=getdate();
srand($today['mday']+$today['month']+$today['year']);
$r=rand(0,$i-1);
echo "<img src=\"flags/{$imgs[$r]}\" alt=\"Photo\" />";
}
?>
Thank you
Brian