28 || username.length alert(用户名长度不符合要求【3-28个字符】 username.length); return false; } if ( passwd != passwd2 ) { alert(两次输入的密码不一致!); return false; } if ( passwd.length > 28 || passwd.length alert(密码长度不符合要求【5-28个字符】); return false; } if ( checkdata.test(realname) ) { alert(真实姓名包含非法字符,请不要使用特殊字符!); return false; } if ( realname.length > 28 || realname.length alert(真实姓名长度不符合要求【3-28个字符】); return false; } if ( question.length > 98 || question.length alert(密码提示问题长度不符合要求【6-98个字符】); return false; } if ( answer.length > 98 || answer.length alert(问题答案长度不符合要求【3-98个字符】); return false; } //脚本学堂 http://bbs.it-home.org if ( ! checkmail.test(email) ) { alert(e-mail包含非法字符!); return false; } if ( email.length > 48 || email.length alert(e-mail长度不符合要求【5-48个字符】); return false; } if ( checkdata.test(address) ) { alert(联系地址包含非法字符!); return false; } if ( address != && address.length > 48 ) { alert(联系地址长度不符合要求【48个字符以内】); return false; } if ( checkphone.test(phone) ) { alert(联系电话包含非法字符!); return false; } if ( address != && ( phone.length > 18 || phone.length alert(联系电话长度不符合要求【7-18个字符】); return false; }}
复制代码
php过滤特殊字符实用函数php表单提交特殊字符过滤方法html特殊字符过滤php类url链接中特殊字符转义方法php特殊字符转义详解php过滤参数特殊字符防注入php 过滤非法与特殊字符串的方法php特殊字符处理函数的例子