https://www.icyphoenix.com/viewtopic.php?f=33&t=7168&p=49079#p49079 ----------------------------------- Mighty Gorgon Tue 25 May, 2010 20:45 Random Avatar ----------------------------------- I have created for a friend a very simple script which creates a random avatar to be used on any forum/blog software. All you have to do is the following: [list=1][*]Create a folder called [b]avatars[/b] in your site root with all the PNG images you want to use (I have forced this script to process PNG). Of course you can use any other name or path, but then you will need to change other references to it accordingly. [*]Rename all the images with a consecutive number with leading zeroes (000001.png, 000002.png, 000003.png and so on...), all files names should be 6 chars long. Then change the number of images [b]$random_avatar_n = 699;[/b] to reflect the total amount. [*]Create a new file called [b]avatar.php[/b], paste in it the code from the box here below and then copy the file it in the folder you just created with all images (i.e.: [b]yoursite.com/avatars/avatar.php[/b]). [code filename=avatar.php linenumbers=false syntax=php][/code] [*]Alter your .htacces (in your root) by adding this line (change path and filenames accordingly): [codeblock]Redirect /avatar.png http://www.yoursite.com/avatars/avatar.php[/codeblock] [*]Go in your browser and just recall the avatar: [codeblock]Redirect /avatar.png http://www.yoursite.com/avatar.png[/codeblock][/list] If you did everything correctly you should have something like this: [codeblock]http://www.mightygorgon.com/avatar.png[/codeblock] Once the page is loaded, just refresh it and the image should change... :wink: I hope you like this script! P.S.: I forgot to mention that you should carefully choose your images to not be too wide... :wink: