if (eregi("block-RandomPic.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
# Directory goes here relative to script
$folder = 'images/random';
# Directory should contain only images, else you can add some more filtering
$i = 0;
$in = opendir ($folder);
while ($x = readdir($in))
{ if ($x != '.' && $x != '..') # Directory should contain only images, else you can add some more filtering
{$imaged[$i++] = $x;}
}
closedir ($in);
srand((double)microtime()*1000000);
$image = $folder.'/'.$imaged[rand(0,sizeof($imaged)-1)];
$content .= "<table align=\"center\" border=\"1\" cellpadding=\"6\" cellspacing=\"6\" style=\"border-collapse: collapse\" bgcolor=\"#fffff0\" bordercolor=\"#111111\" width=\"138\" height=\"100\">";
$content .= "<tr><td align=\"center\"><a href=\"http://hsk.uzipp.com/optiplex.html\" target=\"_blank\"><img src=\"$image\" alt=\"Click Image\">";
$content .= "<align=\"left\"><a href=\"http://www.lvoncall.com\" title=\"Random Pic ver 2.0\" target=\"_blank\">.</a></tr></td></table>"; |