Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.