Jump to content

weird array problem


sniperscope

Recommended Posts

Hello

i am writing a html form but i have problem with reading array.

Here is html form:

<tr style="background-color: rgb(254, 242, 99);"><td>dghhf
							<input name="id[]" value="<?php echo $row['id']" type="hidden">
							<input name="dbcheck[]" value="IF_THERE_IS_RECORD_TYPE 1 OR TYPE 0" type="hidden"></td>
							<td align="center"><input name="chk1[]" checked="checked" type="checkbox">chk1
								<input name="chk2[]" type="checkbox">chk2
								<input name="chk3[]" type="checkbox">chk3</td>
							<td align="center">
								<select name="StartHour[]">
								<option value=""></option>
								<option value="00">00</option><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05" selected="selected">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option>	</select>:<select name="StartMin[]"><option value=""></option><option value="00">00</option>
						<option value="30" selected="selected">30</option></select> ~ <select name="EndHour[]">
								<option value=""></option><option value="00">00</option><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20" selected="selected">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option>	</select>:<select name="StartMin[]"><option value=""></option><option value="00" selected="selected">00</option>
						<option value="30">30</option></select></td></tr>

 

Above HTML works great and no problem however my php code always take first record. Here is php section:

<?php
$TODAY = strtotime($_GET['d']);

if(isset($_POST['WorkEntry']))
{
	for($ii=0; $ii<count($_POST['girl_id']); $ii++)
	{
		if(isset($_POST['chk2'][$ii])){
			$To = "";
			$From = "ASK";
		} else{
			$To = $_POST['StartMin'][$ii];
			$From = $_POST['StartHour'][$ii];
		}

		if(isset($_POST['chk3'][$ii]))
			$ei = 1;
		else
			$ei = 0;

		if($_POST['dbcheck'][$ii] == 1)
		{
			echo $_POST['dbcheck'][$ii];
		}
		else
		{
			if(isset($_POST['chk1'][$ii]))
			{
				$DELETE = "DELETE FROM time_table WHERE _id = '" .$_POST['_id'][$ii]. "' AND w_date = '" .$TODAY. "'";
			}
		}
		echo $ei ."<BR>";
	}
}
?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.