Example:
Okay, for starters, you need some images:
- image.gif - this is the main image you will be working with; the one you will be linking to on forums and websites.
- image.php - this is the php code, the one that is renamed and embedded into the gif image, therefore making the image run a basic php script.
- .htaccess - this comes with almost all websites, the small file that is usually blank.
- image1.gif, image2.gif, image3.gif... as many as you want, with whatever name you want them to be called.
Open up image.gif in whatever drawing software you have and make it a 1x1 pixel image, as this saves space.
Edit image.php and add this code, replacing the names with the names you chose, and numbers with numbers you chose:
<?
//Code made by Rokan, with help from Oosband.
header("Content-type: image/gif");
$img = 5; //the amount of images you have
$num = rand(1,$img); //generates random number between 1 and the number you set $img to.
$im = imagecreatefromgif("image".$num.".gif"); //creates the image, and layers it, in a way, on top of image.gif.
imagegif($im); //create the gif image itself.
imagedestroy($im); //destroy it again to save space - it only needs to be loaded once.
?>Alright. Now, your php code, if you go to the link of your php code in your browser, should give you that generated image. All thats left is a small code in your htaccess file.
Put the following into your .htaccess file:
RewriteEngine on RewriteRule avatar.gif avatar.php
You might well have to change the paths to the files, but apart from that it should be all working.
I thought that maybe all those with showcases or a big load of avatars that they can't choose out of could use this and show them all off.
Enjoy ^___^













Sign In
Register
Help




MultiQuote






