|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I am new to this so sorry for what is probably a simple question...
I want to have a picture that changes at random each time you go to the page so that it is different. Thank you |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
prophet wrote:
> I am new to this so sorry for what is probably a simple question... > > I want to have a picture that changes at random each time you go to the page > so that it is different. http://www.google.com/search?query=w...picture&num=50 -- Ed Mullen http://edmullen.net Why do we say something is out of whack? What is a whack? |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
On Apr 13, 7:48 pm, "prophet" <M_Mo...@hotmail.com> wrote:
......or do it server-side with a scripting language, perhaps php function randPicName() { $cnt=-1; $dir = opendir("/var/www/my-site/my-images/my-rands"); while ( $file = readdir($dir)) { if($file[0] != ".") /// or call some fancier isImage function { $cnt++; $pics[$cnt] = trim($file); } } srand((double)microtime()*1000000); $randval = rand(2,$cnt); $pic = $pics[$randval]; /// this is an image name only, so you'd /// have to prepend a path to make an img src url with it. return ($pic); } |
|
![]() |
| Outils de la discussion | |
|
|