0

I have this idea of a page i want to create but i really don't know how i would implement it . I want to create a page with some pictures and below each picture there would be a check box , i want people to be able to select the check box click next and when they are at the next page the item they checked would automatically be in a dropdown list .

4
Contributors
6
Replies
8
Views
6 Years
Discussion Span
Last Post by Sadun89
0

Rather I want to create a page with some pictures and below each picture there would be a check box , i want people to be able to select the check box click next and when they are at the next page the name of the item they checked would automatically be displayed . something similar to what happens here http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_CHECKBOX.html when you select either onions or mushrooms and click submit

0

Hi urtevedi , PHP is what i would like to use for this . I would be very grateful if you could help out.

0

What did you try yet?
In PHP, you can access GET variables (if you used method=get in your form) in the superglobal $_GET, and the POST variables (if method=post) in $_POST. For example, if you have a checkbox with name=someCheckbox, $_GET (or post, but get is probably better in this case, as you're not putting anything in a database) will be 'on' or '' (checked or not). Hope that helps.

0

your first html page

<form name=frm id=frm method=post action=showselected.php>
<img src='imga.jpg' ><checkbox name=chk id=chk value='imga.jpg'><br>
<img src='imgb.jpg' ><checkbox name=chk id=chk value='imgb.jpg'><br>
<img src='imgc.jpg' ><checkbox name=chk id=chk value='imgc.jpg'><br>
<img src='imgd.jpg' ><checkbox name=chk id=chk value='imgd.jpg'><br>
<img src='imge.jpg' ><checkbox name=chk id=chk value='imge.jpg'><br>

<input type=submit value=submit>
</form>

showselected.php

<?php
   $selcount=count($_POST['chk']);
   echo "YOu have selected following $selcount images:<br>";
   for($i=0;$i<$selcount;$i++)
   {
       echo $_POST['chk'][$i]."<br>";
   }
?>

Edited by urtrivedi: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.