Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to do random header image?
#13
Yeah my script is a little different but you could simply write a component that does this.

Code:
<style>
whatever {
   background-image: url('http://pathtoimage/images/imagename_<?php echo rand(1,100); ?>.jpg');
}
</style>

your images would have to be named something with a sequential number range in it.
Or you would have to read the images folder and load the filenames into an array then randomly select an array index based on the length.

using a script as the css background sounds like a good , idea, butit has to send the proper headers or redirect to the image file, and usually you have to deal with paths and having executing code in your uploads folder.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply


Messages In This Thread
How to do random header image? - by tdem - 2012-10-21, 10:27:32
RE: How to do random header image? - by Carlos - 2012-11-09, 08:22:08
RE: How to do random header image? - by shawn_a - 2012-11-09, 11:36:25
RE: How to do random header image? - by Timbow - 2012-11-09, 23:35:15
RE: How to do random header image? - by shawn_a - 2012-11-10, 00:27:26
RE: How to do random header image? - by Timbow - 2012-11-10, 01:26:54
RE: How to do random header image? - by shawn_a - 2012-11-11, 01:10:20
RE: How to do random header image? - by Timbow - 2012-11-11, 22:55:52
RE: How to do random header image? - by shawn_a - 2012-11-12, 01:36:05
How to do random header image? - by Connie - 2012-10-21, 18:46:40
How to do random header image? - by Carlos - 2012-10-21, 19:33:34
RE: How to do random header image? - by tdem - 2012-11-07, 12:50:02
RE: How to do random header image? - by Timbow - 2012-11-09, 05:49:00
RE: How to do random header image? - by Carlos - 2012-11-09, 06:55:15
RE: How to do random header image? - by Timbow - 2012-11-09, 07:26:02
RE: How to do random header image? - by tdem - 2012-11-09, 11:48:34
RE: How to do random header image? - by Timbow - 2012-11-09, 17:40:55



Users browsing this thread: 1 Guest(s)