新的验证类可以支持自定义错误信息,“=”后面是自定义验证提示信息!

演示地址:[url=http://blog.meiu.cn/demos/validate/]http://blog.meiu.cn/demos/validate/[/url]

验证格式: [code]title|标题|string=类型不正确!|require=必须要填写!|length(8:)=长度只能大于8! length(:20)=长度只能小于20!
age|年龄|digits=年龄类型不正确!|require|size(10:80)
email|email地址|email|require|
addtime|时间|time|require|time_format(Y-m-d)=时间格式不正确
ipaddr|IP地址|ipv4||
password|密码|string|require|equal(title)=密码不相等! length(6:)=密码长度不正确!
a|测试a|float||length(0:199.99) test(5)=设置错误
b|用户名|username=用户信息错误!||[/code]

可能实现上稍微显得有些弱智,但是主要是提供给大家一种方便处理表单的方式,希望水平高的网友帮我修改此类!

以下为代码和实例文件:
[file][attach]93[/attach][/file]

 

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
验证你是否是机器人,请输入以下图片中的单词。 点击图片可以收听此验证码。
点击收听验证码