2 Replies - 436 Views - Last Post: 29 May 2012 - 10:43 PM Rate Topic: -----

#1 Benjamin21  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 29-May 12

problem select values with checkboxes

Posted 29 May 2012 - 11:53 AM

Hii,
So here is the problem, i have managed to create checkboxes with names retrieved from my mysql database. How can i set that when you check one or more of the checkboxes and click on submit, you see only those boxes you selected.I want to make that you select the data you need,and by checking and clicking submit you see details on the data you seleced.

Here is my progress so far:


<?php

	include 'spoj.php';
	$br=0;
	
	echo'Select:';
	
	$up = ("SELECT * FROM namirnice");
	$result = mysql_query($up);
	while($row = mysql_fetch_array($result))
	{
		$br = $br+1;
		echo '<br><input type="checkbox" name="$br" value="$br">'.$row['ime_namirnice'] ;
	}
	echo'<form action="" method="POST">
	<input type="submit" name="select" value="Select">
	</form>	';
		
?>


 


Is This A Good Question/Topic? 0
  • +

Replies To: problem select values with checkboxes

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2892
  • View blog
  • Posts: 10,027
  • Joined: 08-August 08

Re: problem select values with checkboxes

Posted 29 May 2012 - 01:48 PM

See Post #4.
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3485
  • View blog
  • Posts: 10,052
  • Joined: 08-June 10

Re: problem select values with checkboxes

Posted 29 May 2012 - 10:43 PM

a) only checked checkboxes are submitted
b) only checkboxes inside a <form> are submitted
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1