• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

PHP random image.. Help a noob out

Vegitto

Diamond Member
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?
 

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
 
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.. 🙁
 
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??
 
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.
 
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 🙁.
 
Back
Top