Help - Search - Members - Calendar
Full Version: Image Rotating Program?
Sal's RuneScape Forum > Everything... Not RuneScape > Tech Talk > Tech Discussion
Reloaded
how do you get a file that the image rotates to a different one every time you refresh the page. how do you do that?
Toungy
As in display a random image each time someone views a page?

You can display a random image using this script:

CODE
<?php

$pages = array('img1.png', 'img2.png', 'img3.png');

echo '<img src="'.$pages[rand(0,count($pages)-1)].'" />';

?>
Reloaded
QUOTE(Toungy @ Oct 16 2007 at 04:42 PM) *
As in display a random image each time someone views a page?

You can display a random image using this script:

CODE
<?php

$pages = array('img1.png', 'img2.png', 'img3.png');

echo '<img src="'.$pages[rand(0,count($pages)-1)].'" />';

?>


can i specifiy the image that will be next in line? and can i use this php code on the forum??? in my signature?

test:

<?php

$pages = array('http://img165.imageshack.us/img165/6236/tshirtmarmyblack240newqi6.jpg', 'http://img165.imageshack.us/img165/8425/tshirtmgunheadblue240neyh7.jpg', 'http://img100.imageshack.us/img100/9000/tshirtmipwnblack240newbz7.jpg');

echo '<img src="'.$pages[rand(0,count($pages)-1)].'" />';

?>
Toungy
Using it on this forum would be impossible. You could create a PHP script that displayed signatures in order from one URL, but that'd be a bit complicated. (plus, you'd need a host) Try Googling something?
Drolleke
there's one in my sig: http://random.mrfrufru.com/

you can't choose whats next in line, but it does display a random image of a list of images you upload, and you can use it on sites and forums.
Reloaded
QUOTE(Drolleke @ Oct 17 2007 at 09:18 AM) *
there's one in my sig: http://random.mrfrufru.com/

you can't choose whats next in line, but it does display a random image of a list of images you upload, and you can use it on sites and forums.


will the actuall image appear in your sig or do they have to press on the link? do you have to register/pay for service?
Drolleke
... I said there was one in my sig. its the right image.
They don't need to click, and you don't need to pay, just sign up.
Reloaded
QUOTE(Drolleke @ Oct 18 2007 at 01:33 AM) *
... I said there was one in my sig. its the right image.
They don't need to click, and you don't need to pay, just sign up.


very nice i will sign up!!! you get your own link right? yay it worked! thanks guys!!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.