Sig rotator?

If you have your own webhosting the you can rotate on any forum using a rotate.php file.

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]);
?>

Then just put your image files along with that as rotate.php in your folder on your web space and link to rotate.php as an image.

Easy...
 
If you have your own webhosting the you can rotate on any forum using a rotate.php file.

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]);
?>

Then just put your image files along with that as rotate.php in your folder on your web space and link to rotate.php as an image.

Easy...

Or you could do it in a couple of lines:

PHP:
$images = glob("{*.jpg,*.JPG,*.jpeg,*.JPEG,*.png,*.PNG}", GLOB_BRACE);
readfile($images[array_rand($images)]);
 
Or you could do it in a couple of lines:

PHP:
$images = glob("{*.jpg,*.JPG,*.jpeg,*.JPEG,*.png,*.PNG}", GLOB_BRACE);
readfile($images[array_rand($images)]);

Aha!


rotate.php:
rotate.php


rotate2.php:
rotate2.php
 
Back
Top Bottom