Random Background Images...

Joined
Jun 1, 2008
Messages
23
Reaction score
0
Points
1
Your Mac's Specs
iBook G4
Does anyone know if the following is possible to setup - if so, how:

Same homepage but there exists the possibility of getting 1 of 3 possible background images incorporated into a page - therefore if user 1 accesses homepage, they may get background image X, user 2 accessing homepage may get say background image Y, or Z or even X...

Thx in advance.

^o^
 
Joined
Jun 25, 2005
Messages
3,231
Reaction score
112
Points
63
Location
On the road
Your Mac's Specs
2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
I did something similar (a foreground image) via a server side include that executed a Perl script on the server. I had to stop that as my current host didn't support server side includes. You can quick figure that out via that link and a quick test page.

An alternative might be to create a Javascript with a list of images and to randomly pick one. The limit here is that someone may have turned off Javascript execution. In that case you could set it up to show a fixed image.
 
Joined
Apr 23, 2007
Messages
377
Reaction score
4
Points
18
Location
Coatesville, PA
Your Mac's Specs
MBP 15", 2.33 GHz, 2Gb
I would go with the Javascript solution, as it's pretty easy to manage:

http://www.javascript-page.com/ranimage.html

That's one example. And as xstep said, they may have javascript turned off, but there's not much you can do about that. For the most part people usually don't, and if they do it's just a pic so no big deal.
 
OP
B
Joined
Jun 1, 2008
Messages
23
Reaction score
0
Points
1
Your Mac's Specs
iBook G4
Thx for the info guys - for me, Javascript is the way to go - ie. easier for me to understand, so will definitely check out the attached link and have a play... Thx again.

^o^
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top