我正在发布一个包含一些数据的表单,但我得到的是空的 POST 数组。形式是
<form name="opening-statistics" action ="<?php echo base_url()?>statistic/openings">
<select name="titles" multiple="multiple">
<?php foreach($titles as $title) { ?>
<option value="<?php echo $title['idtitles']?>"><?php echo $title['title']?></option>
<?php } ?>
</select>
<input type="submit" name="submit" value="Submit">
在我的控制器中,我有
public function openings(){
$data['boxes'] = $this->Statistic_model->getBoxes();
$data['titles'] = $this->Statistic_model->getTitles();
if($this->input->post()){
echo 'I am here';
$form = $this->input->post();
var_dump($form);
exit();
}
else{
echo 'I am here';
$this->load->view('statistic/openings-statistics', $data);
}
}
在我的路线中,我有
$route['statistic/openings-statistics'] = 'statistic/openings';
它总是出现在 else 语句中
谁能告诉我原因?
提前致谢