<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<script language = "javascript">
function subNum(){
var num = document.getElementById('strNum').value;
num = num.toString();
alert(num);
if(!isNaN(num)){
var lenNum = num.length;
if(lenNum == 18){
for(var i=0; lenNum; i++){
numCode = num.charCodeAt(i);
if((numCode>65248)||(numCode==12288)){
alert('有全角数字,请仔细检查!');
break;
}
}
var res = 8888 - num.substr(7, 4);
if(res == 4444){
alert('满足');
window.location.href = 'enter.php';
}else{
alert('不满足');
window.location.href = 'back.php';
}
}else{
alert('数字位数不对,请仔细检查!');
}
}else{
alert('非数字,请仔细检查!');
}
}
</script>
</head>
<body>
<table>
<tr>
<td>请输入半角18位纯数字</td>
<td><input type="text" id="strNum" /></td>
<td><input type="button" onclick="subNum()" value="验证" /></td>
</tr>
</table>
</body>
</html>
简单写了下 ,不一定正确,话说你0分玩个啥呀,唉,没有用到PHP,js就可以了,PHP还要单独写个页面
温馨提示:答案为网友推荐,仅供参考