【发布时间】:2012-05-18 11:51:07
【问题描述】:
在我将表单切换为 method="get" 之前,我的表单运行良好。现在我无法让 form_validation->run() 评估为 TRUE。
这是我打开表单的方式:
echo form_open( '', array( 'method' => 'get' ) );
这是唯一需要验证的部分:
$this->form_validation->set_rules( 'states', 'states', 'required' );
这是我检查表单是否经过验证的方式:
if( $this->form_validation->run() == FALSE )
我还需要做什么才能使用 Get 参数吗?我在配置中打开了参数($config['allow_get_array'] = TRUE;)。如果我跳过验证,表单可以正常工作,所以我知道 CI 系统可以正常读取 url。
【问题讨论】:
标签: forms validation codeigniter post get