PHP Random Background Image

Myspace Scripts

Author's Comments

Look carefully for specific instructions

what this script does is loads up any of the images that you put into the php script

first thing your gonna need is a php hosting site
there aren't that many around but try google

second thing is get all your image hosted
(i recommend www.imageshack.us)

ok third thing, you need to make the php script
its not that difficult, open up notepad, its the easiest
(i recommend notepad2)

ok copy this php script


<?
$random = array(
'URL to image',
'URL to image',
'URL to image'
);
shuffle($random);
header("Location: $random[0]");
?>


ok, i only used 3 images but you can add more
just that last one where you put the image URL
cannot have a comma at the end because its ending the list

once you have inputed the URL's upload
*note all images do not have to be same size unless your putting them into the second code i give

once you have them uploaded just input the URL to the PHP script into the code given below

*note the code below is just the easiest and most common code people will use
there are other ways to use this code
such as the CSS Rollover Script i contributed a while back
http://www.createblog.com/scripts/download.php?id=325
or to place it in a regular image would be more difficult
you would have to make each image the same dimensions
and place the php script as a background image such as:


<div style="background-image:url('URL TO PHP SCRIPT'); width:XX; height:XX; overflow:hidden; visibility:visible">

Script Code

Copy and paste to About Me

Help

Script Comments

Showing latest 3 of 3 comments

In responce to caleb4992: I am guessing PHP..
But that is only my opinion..=]

By iPityForiPodRIPJoe on Aug 3, 2008 10:30 pm

What type of file do you save the notepad script as to upload it?

By caleb4992 on May 4, 2008 6:57 pm

theres actually a site that kinda creates something similar to this, only without having the people have to manually insert the urls into the php script then reformat it to an different extension

http://www.abrax. us/Katamari/Random/ImageGen.ph p

By wolfreak_99 on Jan 18, 2008 5:48 pm

Script Details

Author Loudsur13 View profile
Submitted on Oct 8, 2006
Page views 130,480
Favorites 51
Comments 3

Script Tags