Jump to content
xisto Community
Sign in to follow this  

The Best Sig Rotation Script Yet only 9 lines of code

Recommended Posts

Yes, this is yet another sig rotation sript. It is possibly the simplest one yet being only 9 lines of code. It reads all the graphic files in the current directory and randomly chooses one to display. No need to edit the script as you add and remove sig files, the script will read the file list each time.

Save the code below to a file called index.php and put it in in a directory called randomsig.png along with your sig files.

<?php Header("Content-Type: image/gif");$sigarray=array();if ($handle = opendir("./")) {  while (false !== ($file = readdir($handle))) {   if(stristr($file, ".gif") or stristr($file, ".jpg") or stristr($file, ".png")){  array_push($sigarray,$file);} } }closedir($handle);shuffle($sigarray);readfile(end($sigarray));?>

Then put the following code in your signature block.
Obviously change 'your.domain.name' to YOUR domain or subdomain name.

Those that know a little about PHP will notice I have not 'seeded' the random number generator, this is because it is not required with the version of PHP used at Xisto.

That's all there is to it, enjoy! :ph34r:

Notice from snlildude87:
I am accepting this only because the code is different from the other two sig rotators, but next time, please submit only original IDEAS.

Edited by snlildude87 (see edit history)

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.