<head>
<META http-equiv="Content-Type" content="text/htmlcharset=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=0lenNumi++){
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还要单独写个页面
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)