|
Post by Elite Anubis Guard on Oct 14, 2005 13:08:44 GMT -5
How exactly do you make the rotating JPG banner?
|
|
|
Post by Valórin on Oct 15, 2005 18:17:26 GMT -5
Is that directed at me? Firstly I use a huge bit of trickery. What you see as: sgu.valorin.net/randBanner.jpgThe file you are running is actually sgu.valorin.net/randBanner.jpg/index.phpYes, randBanner.jpg is a folder name, and because it is such the server will return the index.php file inside it when it is called, thus returning a random image, while pretending to be a .jpg. Many scripts in forums and such check image extensions to make sure they are real images and not .php files..... which it is The index.php file contains this script <?PHP header("Content-type: image/jpg"); //Tell the browser its a jpg image
$pic[] = < array of images > ;
$max = count($pic) - 1; $this = rand(0, $max); //Pic a random image readfile($pic[$this]); //Open chosen image file ?>
Make sense?
|
|
|
Post by Elite Anubis Guard on Oct 16, 2005 3:03:50 GMT -5
I get what you mean...I take it array of image is the name or URL?
|
|
|
Post by Valórin on Oct 16, 2005 6:28:57 GMT -5
An array with all the file names (and links to them). I am planning on developing a version which just reads all the files in a folder, so all you need is to do is put the index.php in a folder, make a subfolder called images/ and then put the images in there and it will do the rest. Once I do that I'll release the code on my website and give you a link (with proper instructions for use)
|
|
|
Post by Elite Anubis Guard on Oct 16, 2005 9:59:36 GMT -5
Danke shone.
|
|
|
Post by Valórin on Nov 9, 2005 1:09:44 GMT -5
|
|