简单的验证码程序——asp,php,jsp

2008-12-30 11:03
<table border="1" cellpadding="0" cellspacing="0" align="center" width="100%">
<tr><td>
<script language=javascript>
function saveit()
{
if (document.myform.yzm.value=="")
{
alert("抱歉!验证码不能为空!");
return false;
}
if (document.myform.yzm.value!=document.myform.yzm2.value)
{
alert("抱歉!验证码不正确!");
return false;
}
}
</script>

<form action="" method="post" name="myform" target="_self" onSubmit="return saveit();">
<table border="1" cellpadding="0" cellspacing="0" align="center" width="100%" >
<tr><Td width="19%" height="30" align="center">
<input name="yzm" type="text" class="tex2" size="8" maxlength="4">
<%
dim temprnd
Randomize
temprnd=cstr(Int((9999 - 1000 + 1) * Rnd() + 1000))
response.Write (temprnd)
%>
<input name="yzm2" type="hidden" value="<%=temprnd%>">
</Td>
</tr>
<tr><Td align="center" height="30">
<input type="submit" name="Submit6" value="提交">
<input type="reset" name="Submit7" value="重置">
</Td></tr>
</table>
</form>
</td>
</tr>
</table>



简单的验证码程序——asp,php,jsp
发表评论
昵称 [注册]
密码 游客无需密码
网址
电邮
打开HTML 打开UBB 打开表情 隐藏 记住我