Home >Backend Development >PHP Tutorial >js弹窗出错。高手帮改一下。解决思路

js弹窗出错。高手帮改一下。解决思路

WBOY
WBOYOriginal
2016-06-13 10:14:33976browse

js弹窗出错。高手帮改一下。急急急!!!!!!

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php $qq=$_POST['qq'];if(!$qq==""){    if( strlen( $qq ) > 12 || strlen( $qq )  alert('对不起,你输入的QQ号码无效.请重新输入.');history.back();";        exit();    }?>
QQ号码吉凶查询:



加粗部分出错。不会弹出提示。请高手帮看下,谢谢。/

if语句的前段好用。$qq ) > 12 || strlen( $qq ) 后段不好用。 !is_numeric( $qq ) || $qq
------解决方案--------------------
可以用正则 /^[1-9][\d]{4,11}$/ 匹配

is_numeric 对于 “00000001”,“1e10”等都是合法的
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn