PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I've made the script to get a random image using Curl because my host has opendir() disabled but I've not been able to come up with a method for creating a random image and have a background that goes with it.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
here is the concept assuming you have all your images defined, why not create an array of your images
$bg= array
(
"background1.gif"
, "background2.gif"
, "background3.gif"
);
$img= array
(
"image1.gif"
, "image2.gif"
, "image3.gif"
);
// get images as such
$n= rand(0,count($bg));
$bgSelected= $bg[$n];
$imgSelected= $img[$n];
// read it in and output it to page ...
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]