Jump to content

html form variables(mainly image value) to php


pragan

Recommended Posts

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.

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.

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.