Thread: Random sig not being very random

View Single Post

  #1 (permalink)  

Old 09-22-2006, 03:30 PM

Random sig not being very random

Fixed Version.

PHP Code:
<?php
$folder 
'';
$exts 'jpg jpeg png gif';

$files = array(); $i = -1;
if (
'' == $folder$folder './';

$handle opendir($folder);
$exts explode(' '$exts);
while (
false !== ($file readdir($handle))) {
    foreach(
$exts as $ext) {
        if (
preg_match('/\.'.$ext.'$/i'$file$test)) {
            
$files[] = $file;
            
$i++;
            }
        }
    }
closedir($handle);
mt_srand((double)microtime()*1000000);
$rand mt_rand(0$i);

header('Location: '.$folder.$files[$rand]);
?>
Broken php was removed.

Also I see no coding support forum so in here I posts it. It wont be random and it will. The image changes everytime I restart FF?*
__________________


/Oh look, my gaydar keeps pointing south? No, wait, it's just pointing at me.../


/F665AB/
/*If you believed this, are you this guy?/

Last edited by Conan; 09-22-2006 at 05:35 PM.
[ reply ]
Conan

Conan is offline [ Voiderator ]

Conan's Avatar

Join Date: Nov 2004

Location: The Void.*

Posts: 831

Send a message via ICQ to Conan Send a message via AIM to Conan Send a message via MSN to Conan