Sig Randomizer
Posted: Sun Jun 20, 2004 8:16 pm
[b]Originally Posted By Tech On GraphixGround Apr 1 2004[/b]
SIG RANDOMIZER
by hermann
What The Heck?
This new version of the sig randomizer (thanks to fred) requires a minimum of configuration and no maintenance at all!!
But why is this better than fred\'s?
With my new (poorly coded) script you just specify a folder which contains your sigs. The php script will automaticly randomize all images in this folder
This means you can upload new sigs to this folder without thinking about configurating the script. Now does it get any easier?
* Requirements:Notepad
* Some sigs
* A host that supports PHP
* Configuration:Copy and paste the php code into notepad
* Specify the source folder. This is the relative folder where your sigs are stored. for instance. If you put \"random.php\" in \"c:\rand\random.php\" and your sigs are stored in \"c:\rand\sigs\\", u set $source to \"sigs\".
* Save the script as \"random.php\" and upload it (to a host that supports php) together with the folder containing your sigs
* Back on the forums use
[code] [IMG]http://myurl.com/myfolder/random.php[/IMG][/code]
For using the randomizer.
Good luck
Hermann
[code]<?php
$filename = "random.php"; //What filename are giving this file?
$source = "sigs"; //In which folder are the sigs located? Type "./" for the same folder as this file.
//-----------Don\'t touch below this line-----------//
header("Content-Type: image/gif");
$handle=opendir($source);
$anumb = 0;
while (false!==($file = readdir($handle)))
{
if ($file != "." && $file != ".." && $file != "$filename")
{
$sigs[$anumb] = "$file";
$anumb = $anumb + 1;
}
}
closedir($handle);
$sig = $sigs[mt_rand(0, count($sigs)-1)];
@header ("Location: $source/$sig");
?>[/code]
SIG RANDOMIZER
by hermann
What The Heck?
This new version of the sig randomizer (thanks to fred) requires a minimum of configuration and no maintenance at all!!
But why is this better than fred\'s?
With my new (poorly coded) script you just specify a folder which contains your sigs. The php script will automaticly randomize all images in this folder
This means you can upload new sigs to this folder without thinking about configurating the script. Now does it get any easier?
* Requirements:Notepad
* Some sigs
* A host that supports PHP
* Configuration:Copy and paste the php code into notepad
* Specify the source folder. This is the relative folder where your sigs are stored. for instance. If you put \"random.php\" in \"c:\rand\random.php\" and your sigs are stored in \"c:\rand\sigs\\", u set $source to \"sigs\".
* Save the script as \"random.php\" and upload it (to a host that supports php) together with the folder containing your sigs
* Back on the forums use
[code] [IMG]http://myurl.com/myfolder/random.php[/IMG][/code]
For using the randomizer.
Good luck
Hermann
[code]<?php
$filename = "random.php"; //What filename are giving this file?
$source = "sigs"; //In which folder are the sigs located? Type "./" for the same folder as this file.
//-----------Don\'t touch below this line-----------//
header("Content-Type: image/gif");
$handle=opendir($source);
$anumb = 0;
while (false!==($file = readdir($handle)))
{
if ($file != "." && $file != ".." && $file != "$filename")
{
$sigs[$anumb] = "$file";
$anumb = $anumb + 1;
}
}
closedir($handle);
$sig = $sigs[mt_rand(0, count($sigs)-1)];
@header ("Location: $source/$sig");
?>[/code]