php - 快速表单验证

标签 php pear quickform

我使用 db dataobject,因此使用 quickform。我遇到了一个问题。想要在客户端设置验证以检查文件扩展名。找不到出路。

字段是这样的:

'pathname' => array(
'type' => 'varchar',
'size' =>255,
'qf_type'=> 'text',
'require' => false,
'qf_client' => true,
'qf_rules' = array('required' => 'file name is required.'),
);



现在我想要一个验证,以在正则表达式的帮助下检查文件的扩展名是否与某些特定格式匹配。
如果有人有想法,请分享。

最佳答案

设置路径名['qf_rules']['regex']时问题已解决。

关于php - 快速表单验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7776695/

相关文章:

php - 使用 sudo : Registry directory is still not writeable by the current user. 为什么?

php - pear HTML_QuickForm2 : How to get the saved session container back in form

php - 使用 php 和 mysql 数据库点击计数器

php - ffmpeg 的问题

php - pear 安装后 Nginx 不运行 php 文件

php - 如何使用 QuickForm 添加禁用的选择选项?

php - 无法导入wordpress数据库出现错误

php - PHP变量类型转换问题

php - PHP PEAR Mail->发送成功/失败结果?