I want the id, weekday, month, month-day, time, time zone, year, inside local IP, and inside global IP to be submitted by the form and end up in $_POST. However, the time zone isn't working, and I don't know why. The time zone is being controlled by the SELECT element, and the name of each tag is 'tz'.
Here is the code to the form in the view:
<form action='/mysecureview/admin_view/log_index.php' method='post'>
<ul>
<input type='hidden' value='<?php echo $id; ?>' name='id'>
<li><label>weekday</label><input <?php echo (($weekday_error == TRUE)?"id='weekday_error'":'')?> type='text' value='<?php echo $wd; ?>' name='wd'></li>
<li><label>month</label><input <?php echo (($month_error == TRUE)?"id='month_error'":'')?> type='text' value='<?php echo $m; ?>' name='m'></li>
<li><label>month-day</label><input <?php echo (($month_day_error == TRUE)?"id='month_day_error'":'')?> type='text' value='<?php echo $md; ?>' name='md'></li>
<li><label>time</label><input <?php echo (($time_error == TRUE)?"id='time_error'":'') ?> type='text' value='<?php echo $t; ?>' name='t'></li>
<select>
<option value="0">Please, select timezone</option>
<?php
foreach(tz_list() as $t) { ?>
<option value="<?php print $t['zone']?>"<?php echo "name='tz'";?> >
<?php print $t['diff_from_GMT'] . ' - ' . $t['zone'] . ' ';
?>
</option>
<?php } ?>
</select>
<li><label>year</label><input <?php echo (($year_error == TRUE)?"id='year_error'":'') ?> type='text' value='<?php echo $y; ?>' name='y'></li>
<li><label>inside local IP address</label><input <?php echo (($ilp_error == TRUE)?"id='ilp_error'":'') ?> type='text' value='<?php echo $ilp ?>' name='ilp'></li>
<li><label>inside global IP address</label><input <?php echo (($igp_error == TRUE)?"id='igp_error'":'') ?> type='text' value='<?php echo $igp ?>' name='igp'></li>
<li><input type='submit' value='submit' name='show'></li>
<input type='hidden' value='update-log' name='action'>
</ul>
</form>
In the controller, I use var_dump($_POST); to get the following output:
array(10) {
["id"] "3"
["wd"] "Mon"
["m"] "Mar"
["md"] "4"
["t"] "15:01:43"
["y"] "2015"
["ilp"] "10.18.149.220"
["igp"] "127.221.137.254"
["show"] "submit"
["action"] "update-log"
}
Why is PHP not sending the time zone through $_POST['tz']?
Aucun commentaire:
Enregistrer un commentaire