store values for input in dimensions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
info@prajaktasoftware.com
Forum Newbie
Posts: 2
Joined: Tue May 05, 2020 12:10 am

store values for input in dimensions

Post by info@prajaktasoftware.com »

I really appreciate prompt reply



As specified by you I am getting values for $_POST['weekday'][$i]

code

Code: Select all

do {  //reading weekday table and assigning id as index
                 
?>
<tr>

  <td class='text15'  >
    <input name="weekday[<?php $rows['id'];?>]" type="checkbox"    value="<?php echo $rows['id'];?>" class='weekday' /> <?php echo $rows['name'] ;?>   


    <br>Timing

    <input type="text" name="timing[<?php $rows['id'];?>]"     class='timepicker timing'  />

  </td>

</tr>

  <?php } while ($rows=$query->fetch()); ?>


after submit


Code: Select all

$cntr=count($_POST['weekday']);
			 
			 echo "weekday count=".count($_POST['weekday']);	
		    
		      echo "timing count=".count($_POST['timing']);
			
 			for($i=8; $i < 	18 ; $i++)
			{   
				  
				echo "<br>".$i." Loop Week day =>". $_POST['weekday'][$i]." timing  =>". $_POST['timing'][$i];
			 
			} 
output

weekday count=5
8 Loop Week day => timing =>
9 Loop Week day =>9 timing =>
10 Loop Week day =>10 timing =>
11 Loop Week day =>11 timing =>
12 Loop Week day =>12 timing =>
13 Loop Week day =>13 timing =>
14 Loop Week day => timing =>
15 Loop Week day => timing =>
16 Loop Week day => timing =>
17 Loop Week day => timing =>

We get the values for

weekday[9], weekday[10], weekday[11], weekday[12], weekday[13]

------------------------------------------------------------

but not getting any values for timing[9], timing[10], timing[11], timing[12], timing[13]



pls help
Post Reply