I could use a signature script that portrays a random picture from a set of 5 jpgs upon every refreshing of a webpage. See my box in my signature now? I want to be able to have a red version of that if I refreshed. Or blue, or green, etc. I have the 5 jpgs, I just need the script that changes the picture randomly upon refreshing. I'd search for it myself but I don't know where to look and Googling is futile. Thanks in advance.
I'd like that too, but also that links the avatar to the signature, so that the two pictures are linked on refresh. Like when you refresh, you get avatar a and sig a, and then refresh again and get avatar c and sig c and so on and so forth.
Note: If you haven't already, you will need to enable .php as a valid image file for signatures. Configuration: Copy and paste the php code into notepad Go into the code and find this: Code: $source = "./" Make a folder on your host called "random_sigs", or whatever you want it to be called, then inside that folder make a folder named "sigs" set $source to "sigs". So the code will then look like this Code: $source = "./sigs" Save the script as "random.php" and upload it (to a host that supports php) to your "/random_sigs" folder (or whatever you called it). Then upload all your sigs to the "/sigs" folder Back on the forums use [IMG]http://myurl.com/myfolder/random.php[/IMG] For using the randomizer. Code: <?php // seed with microseconds - nabbed straight off php.net function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 100000); } mt_srand(make_seed()); $source = "./"; //In which folder are the sigs located? Type "./" for the same folder as this file. //-----------Don't touch below this line-----------// $handle=opendir($source); $i = 0; $sigs = array(); while (false!==($file = readdir($handle))) { if ($file != "." && $file != ".." && eregi ( "(gif|png|jpg)" , $file ) ) { $sigs[$i] = "$file"; $i = $i + 1; } } closedir($handle); $sig = $sigs[mt_rand(0, count($sigs)-1)]; @header ("Location: $source/$sig"); ?>
I'll try and make it easier to understand. Just a tic. Edit: Ok i edited it. If you still can't understand tell me what you can't understand and hopefully I can explain.
Alright, I'm having compications with this. I'm not going to use it on this forum, but anyway...I did what you said but the .php file isn't showing up as an image but as the code itself...do you know what i did wrong?
You mean like I had for my PS3 set? I'll try and get you the code for it... -edit--- sig.jpg Code: <?php $dh = opendir("."); while (false !== ($file = readdir($dh))) { if (preg_match('/\.jpg$/i', $file) and $file != "avatar.jpg") // sanning for .jpg files only and stopping avatar.jpg being loaded (you will run into errors if this isnt here) { $filelist[] = $file; } } srand((double)microtime()*1000000); $picnum = rand(0, sizeof($filelist) - 1); header("Location: " . $filelist[$picnum]); closedir($dh); ?> .htaccess Code: AddType application/x-httpd-php .jpg Just put those two files in a directory together with .jpg files only. I don't think other filetypes work, but if they do, don't shoot me. Hope this helped.
Ok so do I have to save those codes in notepad and then load them to my host? What do I save them as? EDIT: Do I save them as sig.jpg and .htaccess?
If it's not working, then get a different host that allows PHP and .htaccess files. I'm pretty sure lycos.co.uk allows it. I can't remember thou.