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

WBOY
Release: 2016-06-13 10:14:33
Original
963 people have browsed it

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();    }?>
Copy after login
QQ号码吉凶查询:



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

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

is_numeric 对于 “00000001”,“1e10”等都是合法的
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!