怎么把验证码加到登录页?
<!--#include file=conn.asp--><%
if request("act")="check" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from admin where username='"&trim(request.form("username"))&"' and password='"&trim(request.form("password"))&"'",conn,1,1
if rs.eof and rs.bof then
response.write "<script>alert('登陆失败!用户名或者密码错误.');history.back(1)</script>"
response.end
else
session("user")=rs("username")
response.redirect "admin.asp"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理登陆</title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<%
if request("XHType")="" or request("XHType")="login" then
call login()
elseif request("XHType")="logout" then
call logout()
end if
%>
<script language="javascript">
function check(){
if(form1.username.value==""){
alert("用户名不能为空!");
form1.username.focus();
return false;}
if(form1.password.value==""){
alert("密码不能为空!");
form1.password.focus();
return false;}
return true;
}
</script>
<body bgcolor="#F0F0F0">
<%
sub logout()
session("user")=""
call login()
end sub
%>
<%sub login()%>
<div align="center">
<p> </p>
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" height="200">
<tr>
<td>
<div align="center">
<table border="1" width="50%" id="table2" cellspacing="1" cellpadding="5" bgcolor="#C7E8FA" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
<form action=?act=check method=post name=form1 onSubmit="return check()">
<tr>
<td bgcolor="#008080">
<p align="center"><font color="#FFFFFF"><b>管理登陆</b></font></td>
</tr>
<tr>
<td>
<p align="center"><b>用户名:</b><input type=text name=username></td>
</tr>
<tr>
<td>
<p align="center"><b>密码:</b>
<input type=password name=password size="21"></td>
</tr>
<tr>
<td>
<p align="center"><input type=submit name=submit value=登陆></td>
</tr>
</form>
</table>
</div>
</td>
</tr>
</table>
</div>
<%end sub%>
</body>
</html>