Vicious101
03-30-2004, 10:36 PM
this is one of those copy and paste tuts
first were gonna make a new folder now put all the pics into the folder and now open up word put this in
<?
$folder=opendir(".");
while ($file = readdir($folder))
$names[count($names)] = $file;
closedir($folder);
sort($names);
$tempvar=0;
for ($i=0;$names[$i];$i++){
$ext=strtolower(substr($names[$i],-4));
if ($ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$ext==".png"||$ext==".swf"){$names1[$tempvar]=$names[$i];$tempvar++;}
}
srand ((double) microtime() * 9999999999999999);
$rand_keys = array_rand ($names1, 2);
$slika=$names1[$rand_keys[0]];
if (!isset($tnsize)) {
header ("Location: $slika");
}
?>
now save it as a .php and also put it into your new folder
now to disply the random pics
put in <img src=link to random.php>
thats what i did and it works for me
pleaz enjoy
first were gonna make a new folder now put all the pics into the folder and now open up word put this in
<?
$folder=opendir(".");
while ($file = readdir($folder))
$names[count($names)] = $file;
closedir($folder);
sort($names);
$tempvar=0;
for ($i=0;$names[$i];$i++){
$ext=strtolower(substr($names[$i],-4));
if ($ext==".jpg"||$ext==".gif"||$ext=="jpeg"||$ext==".png"||$ext==".swf"){$names1[$tempvar]=$names[$i];$tempvar++;}
}
srand ((double) microtime() * 9999999999999999);
$rand_keys = array_rand ($names1, 2);
$slika=$names1[$rand_keys[0]];
if (!isset($tnsize)) {
header ("Location: $slika");
}
?>
now save it as a .php and also put it into your new folder
now to disply the random pics
put in <img src=link to random.php>
thats what i did and it works for me
pleaz enjoy