0
Access random file from my server
For example, I want to access a random image from /ex/images. I habe 3 files in this folder: bathroom.png sleep.png grass.png Is there a way to access one of these files randomly?
3 Antworten
+ 3
1) collect n images name in a array b
2) generate a random number r which value is from 0 to n-1
3) b[r] is your random image name
0
@KrOW Is 1 possible with js or Jquery?
0
Sure, but like all client-side code, you will expose some data and i dont know if it allowed in your context... But, like sql_assassin ask you, what is your purpose?