soccerrprp1 Posted October 30, 2010 Share Posted October 30, 2010 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! Link to comment https://forums.phpfreaks.com/topic/217325-select-button-w-image-and-have-that-image-display-on-another-page/ Share on other sites More sharing options...
Eiolon Posted October 31, 2010 Share Posted October 31, 2010 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. Link to comment https://forums.phpfreaks.com/topic/217325-select-button-w-image-and-have-that-image-display-on-another-page/#findComment-1128527 Share on other sites More sharing options...
soccerrprp1 Posted October 31, 2010 Author Share Posted October 31, 2010 thanks. Link to comment https://forums.phpfreaks.com/topic/217325-select-button-w-image-and-have-that-image-display-on-another-page/#findComment-1128549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.