passing values of checkboxes in PHP

From: Date: Mon, 17 May 2004 06:21:00 +0000
Subject: passing values of checkboxes in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-186384@lists.php.net to get a copy of this message
hi list, I have a problem with getting the values of check boxes ... In the form i have many checkbox options created dynamically. All of them have same name but different values. But when user submits the form i am able to access only the value of last checkbox that user cliked. Values of rest of the selection is not displayed/passed. How can i get all the values. many thanks in advance ... followings are my scripts ... form ........this prints lot of check boxes on the from as per the result or previous mysql query ---------------------------------------------------------------- while ($rows2 = mysql_fetch_array($result2)) { echo <input type=\"checkbox\" Name=protid value=\"$variable\"> something ... } I am trying to access these checkbox values in follwing script ........ ----------------------------------------------------------------------- if(isset($_POST['submit'])) { echo "hello"; echo $hell=$_POST['protid']; echo $counts = count($hell); } ?> counts says there is only one value ....(that is value of last checked box) I also tried putting $hell=$_POST['protid'] in a while loop .... did not work. sincerely gowtham -- Ra. Gowthaman, Graduate Student, Bioinformatics Lab, Malaria Research Group, ICGEB , New Delhi. INDIA Phone: 91-9811261804 91-11-26173184; 91-11-26189360 #extn 314

« previous php.general (#186384) next »