Jump to content

Select button w/ image and have that image display on another page


soccerrprp1

Recommended Posts

Would like to be able to click on a radio button that represents an image. Once selected and submitted, have that image display on another page. I have an idea, but need some guidance.

 

BTW, is using php only doable? Is there a simpler or more elegant way to do this?

 

Thanks all!

I assume when you mean PHP only you are not involving a database...

 

So if that is the case, have each radio button assigned a value.  When submitted, get the value.  In your PHP, tell it something like:

 


$value = $_GET['submittedvalue'];

if ($value == 1) {
   echo "<img src=image/image1.jpg>";
} elseif  {
($value == 2) {
   echo "<img src=image/image2.jpg>";
}

 

Just repeat until you've used all your images.  Of course, make sure it is secure and if you are using a database you can make it more elegant.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.