【问题标题】:Form validation is not working in XAmp表单验证在 XAmpp 中不起作用
【发布时间】:2013-07-07 21:40:55
【问题描述】:

我在我的 codeigniter 项目中使用 Xaamp 服务器,项目路径是 xaamp/htdocs/my_proj 。我在我的注册页面中使用 form_validation 库,在我的控制器中我已经加载了它

$this->load->library('Form_validation');

在我的函数中,我已经把验证放在了

$this->form_validation->set_rules('username', 'Username', 'required|min_length[5]|max_length[25]');

但是如果我这样写并且如果我提交表单它显示我的空白屏幕可能表明库未加载。那么我该怎么做才能摆脱这种情况。如果我评论这一行并打印@ 987654324@ 正在打印的用户名。在此先感谢..

【问题讨论】:

  • 空白屏幕通常表示错误,但您关闭了错误显示。谷歌一下。

标签: php codeigniter xampp


【解决方案1】:

如果不是拼写错误,您正在使用Form_validation 库加载,但它应该是form_validation。看看区别。

$this->load->library('Form_validation');
                      ^ // here F is in capital letters.

应该是

$this->load->library('form_validation');
                      ^ // here f is in small letters.

【讨论】:

  • 谢谢@Yogesh 我会试试这个
猜你喜欢
  • 2021-08-28
  • 2021-12-01
  • 2017-07-12
  • 2016-11-11
  • 1970-01-01
  • 1970-01-01
  • 2013-12-06
相关资源
最近更新 更多