[eluser]sustbird[/eluser]
I have a form. When i submit, post values are not populated.
My form code is:
Code:
<?php
$this->load->helper('url');
$add_url = site_url().'risk_close/add';
var_dump($_POST);
?>
<h1 align="center" >Period Closing</h1>
<br />
<div id="pagination">
<table style="border: 1px solid gray" class="tbl" border="0" cellpadding="2" cellspacing="1" width="100%">
<thead>
<tr class="grid_header">
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Closed By
</th>
<th VALIGN='MIDDLE' ALIGN='CENTER' class='tbl_headercell'>
Closing Date
</th>
</tr>
</thead>
<tbody>
<?php $i = 0;
foreach ($risk_close_list as $risk_close) {
$i++;
if (($i%2)==0) { $bgColor = "#FFFFFF"; } else { $bgColor = "#EFF5FB"; }
?>
<tr bgcolor="<?php echo $bgColor; ?>">
<td align="left" nowrap="nowrap"><?php echo $risk_close['closed_by']; ?></td>
<td align="left" nowrap="nowrap"><?php echo $risk_close['closing_date']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
<br /><div class="pagination"><?php echo $page_links;?></div>
</div>
<form action='<?php echo $add_url; ?>' method='POST'>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="center">
<input class="btn" type="submit" name="Submit" value="Close Current Period">
</td>
</tr>
</table>
</form>
In my controller, my code is:
Code:
function add() {
$this->load->helper('url');
$this->load->helper('lookup');
$submit = $this->input->post('Submit');
if ( $submit != FALSE) {
// do db operation...
}
else {
$_SESSION['fmessage'] = 'Period Closing not submitted.';
redirect('/risk_close/', 'location');
}
}
After submitting, it shows: 'Period Closing not submitted.' i.e $submit value not pupulated!
I am stuck with this. Please help.