HighDots Forums  

php random images script?

Web Accessibility alt.html.web-accessibility


Discuss php random images script? in the Web Accessibility forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rene willemsen
 
Posts: n/a

Default php random images script? - 05-26-2005 , 05:43 AM






hi all,

is there sombody who can helpme witht he following, i am ''pretty new'' to
php and am looking for a script to show images randomly at a 10/ 15 seconds
interval. is there anybody who can help me with this or does know where to
find a good template script for this?

thanks in advance,
rene



Reply With Quote
  #2  
Old   
Richard Quick
 
Posts: n/a

Default Re: php random images script? - 05-26-2005 , 06:28 AM






"rene willemsen" <foruminfo (AT) gmail (DOT) com> wrote

Quote:
hi all,

is there sombody who can helpme witht he following, i am ''pretty new'' to
php and am looking for a script to show images randomly at a 10/ 15
seconds
interval. is there anybody who can help me with this or does know where to
find a good template script for this?

thanks in advance,
rene


Do you want the page to refresh every 10-15 seconds and show a new image?

If so you can't do this with PHP alone. In which case it might be better to
try doing it with Javascript.

I wrote a javascript function to change images after set interval recently:

http://www.furniss-foods.co.uk

The only thing is the images aren't random, but ti would be fairly easy to
make it random.

using the Math.random(); function.

The following function will generate a random number betwwen 1 and 4...

function get_random()
{
maxNum = 4;
var ranNum= Math.round(Math.random()*maxNum);
return ranNum;
}

If you put the two scripts together you should be able to get something
you're after...


--
Richard Quick
http://www.chocolatemagazine.co.uk




Reply With Quote
  #3  
Old   
Adrienne
 
Posts: n/a

Default Re: php random images script? - 05-26-2005 , 11:15 AM



Gazing into my crystal ball I observed "rene willemsen"
<foruminfo (AT) gmail (DOT) com> writing in
news:OLhle.1388$e4.404 (AT) newsfe4-win (DOT) ntli.net:

Quote:
hi all,

is there sombody who can helpme witht he following, i am ''pretty new''
to php and am looking for a script to show images randomly at a 10/ 15
seconds interval. is there anybody who can help me with this or does
know where to find a good template script for this?

You might want to think twice about this, or at least give the user the
option to do this. I block animated gifs, and Flash, and javascript because
I find it distracting to what I am reading. A better idea would be an image
gallery.


--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.