5 Replies - 2711 Views - Last Post: 30 October 2012 - 07:17 AM Rate Topic: -----

#1 varunvt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 29-October 12

store checkbox value in session variable ?

Posted 30 October 2012 - 06:14 AM

i am trying to create a page where admin can select the user by select the checkbox .
but dont able to send the value of selected check box to next page



	<form name="form1" action="" method="post">
						<table cellpadding='' cellspacing="0" border="1">
		<tr>
			<td style="text-align:center"><b>Select the row</b></td>
			<td><b>ndex</b></td>
			<td><b>first Name</b></td>
			<td><b>last name</b></td>
			<td><b>middle name</b></td>
			<td><b>email_id</b></td>
			<td><b>password</b></td>
			<td><b>address</b></td>
			
		</tr>
	   <?php while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
	  
	   		
		 ?>
	   		<tr> 
					<td style="text-align:center"> 

	<input name="need_delete[<? echo $rows['index']; ?>]" type="checkbox" id="checkbox[<? echo $rows['index']; ?>]" value="<? echo $rows['emailid']; ?>"></td></td>
					<td><?php print $row['index'] ?> </td>
					<td> <?php print $row['firstname']; ?></td>
					<td> <?php print $row['lastname'];?></td>
					<td> <?php print $row['middlename'];?></td>
					<td> <?php print $row['emailid'];?></td>
					<td> <?php print $row['password'];?></td>
					</tr>
		 <?php } ?>
		 </table>
		 <div style="float:left;width:200px;text-align:right" ><input type="submit" value="delete" name="delete" style="text-align:center"  /></div>
		 <div style="float:left; width:20px">&nbsp;</div>
		 <div style="float:left; width:200px; text-align:left"><input type="submit" value="edit" name="edit" style="text-align:center"/></div>
			<div style="clear:both"></div>
					</form>



Is This A Good Question/Topic? 0
  • +

Replies To: store checkbox value in session variable ?

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3572
  • View blog
  • Posts: 10,414
  • Joined: 08-June 10

Re: store checkbox value in session variable ?

Posted 30 October 2012 - 06:26 AM

what does var_dump($_POST); give you?
Was This Post Helpful? 0
  • +
  • -

#3 varunvt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 29-October 12

Re: store checkbox value in session variable ?

Posted 30 October 2012 - 06:51 AM

View PostDormilich, on 30 October 2012 - 06:26 AM, said:

what does var_dump($_POST); give you?



still not working
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3572
  • View blog
  • Posts: 10,414
  • Joined: 08-June 10

Re: store checkbox value in session variable ?

Posted 30 October 2012 - 06:52 AM

obviously. checking preconditions does not fix errors.
Was This Post Helpful? 0
  • +
  • -

#5 varunvt  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 29-October 12

Re: store checkbox value in session variable ?

Posted 30 October 2012 - 07:07 AM

View PostDormilich, on 30 October 2012 - 06:52 AM, said:

obviously. checking preconditions does not fix errors.


if i try to store the value of checkbox in session variable it only store the value of last checkbox
created in the inside while loop
  <?php while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
	  
	   		
		 ?>
	   		<tr> 
					<td style="text-align:center"> 

	<input name="checkbox[<? echo $rows['index']; ?>]" type="checkbox" id="checkbox[<? echo $rows['index']; ?>]" value="<? echo $rows['emailid']; ?>"></td></td>



Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3572
  • View blog
  • Posts: 10,414
  • Joined: 08-June 10

Re: store checkbox value in session variable ?

Posted 30 October 2012 - 07:17 AM

then you need to check the HTML output (i.e. that one in the browser, without PHP code in it) for duplicate names.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1