If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

To do such your going to need to store the current background image somewhere, for simplicity I've chosen a text file. Below I've constructed a 4-step guide to making a PHP background image switcher that stores it's current image data in a text file named current_bgimage.txt. Currently this script has 3 images (image001.jpg, image002.jpg, image003.jpg) that can be set as the background, you can adjust and add images by editing the Background Imager Changer formStep 1.
Save the following php code as changebgimage.php

<!-- Add the following form to anywhere you would like the ability to change the background image --><!-- Please Note: You must update the action path if you add this form to a file in a different directory --><form method="post" action="changebgimage.php"><select name="bgimage"><option name="image001.jpg" value="image001.jpg">Change Background Image to: image001.jpg</option><option name="image002.jpg" value="image002.jpg">Change Background Image to: Image002.jpg</option><option name="image003.jpg" value="image003.jpg">Change Background Image to: Image003.jpg</option></select><input type="submit" name="submit" value="Change Background Image"></form>

Step 3.
Create a text file named current_bgimage.txt and add the name of your default/current background image:

Code:

example.jpg

Step 4.
Upload the 3 above files along with the background images to your server and open test.php up in your browser. The current background image should be the one you specified above in current_bgimage.txt. Now select a different background image via the Background Imager Changer form and click the Change Background Image button. If you setup my script successfully you should be redirected back to test.php and be presented with a new background image.