pragan Posted January 23, 2009 Share Posted January 23, 2009 Hi, Please help me with this following php html form. I can pass the text field variable to the php page but not able to figure out how to do the same when an image is just selected. without using radio buttons or checkboxes. I am not sure if all the images should be passed as hidden values...please guide me. question: I am trying to have a html form with 15 images and if an image is clicked, i am trying to show what they selected in the next page and then have a link in this page(i.e. php page) saying "click here to finish the selection" ..once they click this then I have to store this in the db. Scenario html code should have five images each having its name and value. form tag will have "submit.php", so when an image is clicked then the value is passed to the next page(i.e. in submit.php). Here i will have a link saying "click to finish" then this will show them a landing page(like finish.php) saying thanks and store that value in db..I am also trying to see the count for this image to see how many people selected this image. Quote Link to comment https://forums.phpfreaks.com/topic/142102-html-form-variablesmainly-image-value-to-php/ Share on other sites More sharing options...
pragan Posted January 23, 2009 Author Share Posted January 23, 2009 any help please? Quote Link to comment https://forums.phpfreaks.com/topic/142102-html-form-variablesmainly-image-value-to-php/#findComment-744299 Share on other sites More sharing options...
premiso Posted January 23, 2009 Share Posted January 23, 2009 Use a checkbox next to the image, if the checkbox is checked that image value gets passed via a form in HTML. Then you would access which was chosen via $_POST (if the form was posted) or $_GET if the form was sent via GET (Post is better for this scenario fyi). I do not think you can just click on an image and have that be selected. If it can you would be using javascript to create an html element on the page dynamically to show that. In which case this is a javascript issue, not php. Quote Link to comment https://forums.phpfreaks.com/topic/142102-html-form-variablesmainly-image-value-to-php/#findComment-744321 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.