PHP random image.. Help a noob out

Vegitto

Diamond Member
May 3, 2005
5,234
1
0
I'm trying to get this little script working.. It works, as in, it will display a random image, but when I try to use it twice, I get the same image twice. How do I make that go away?
 

snapper316

Member
Feb 16, 2006
58
0
0

Try that? Each one of those is a variable and pasting it on the page twice it will return the same final variable value. So maybe try em all with a 2 on the end
 

Vegitto

Diamond Member
May 3, 2005
5,234
1
0
Originally posted by: snapper316

Try that? Each one of those is a variable and pasting it on the page twice it will return the same final variable value. So maybe try em all with a 2 on the end

Ooh, good idea! I'll try that :).

Aww, it doesn't work.. :(
 

snapper316

Member
Feb 16, 2006
58
0
0
explain "doesn't work"

you could try it all with an A or a B on the end instead of 2...shouldnt matter though :\

what's the final img source tag for each group??
 

Vegitto

Diamond Member
May 3, 2005
5,234
1
0
Originally posted by: snapper316
explain "doesn't work"

you could try it all with an A or a B on the end instead of 2...shouldnt matter though :\

I've tried it with numbers and letters before and after the variable, and every time I run the script, I get the same image, twice.

What I want:
Folder with images 1-10.
Run script.
Display randomly, for example image03 and image06.

What I get:
Folder with images 1-10.
Run script.
Display one image, two times. For example, image05 and image05.
 

snapper316

Member
Feb 16, 2006
58
0
0
did you write this yourself or get it from some website?

the A/B should work...


But you might also be able to just do


 

Vegitto

Diamond Member
May 3, 2005
5,234
1
0
Originally posted by: snapper316
did you write this yourself or get it from some website?

the A/B should work...

Heh.. It's from some website, I can't code worth crap...

Unfortunately, it doesn't work :(.