28,391
社区成员
发帖
与我相关
我的任务
分享
<HTML>
<HTML>
<HEAD>
<Title>index.asp </Title>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<META name="Generator" content="Asp Studio 1.0">
</HEAD>
<BODY>
<form action="login.asp" method="post">
<table align="center">
<tr>
<td>用户名: </td>
<td>
<input id="name" type="text" onblur="hf.location.href='check.asp?name='+escape(this.value);"> <span id="pad"></span>
</td>
</tr>
<tr>
<td>密码: </td>
<td>
<input id="pwd" type="password">
</td>
</tr>
<tr>
<td>
<input type="submit" id="tijiao" value="登陆" >
</td>
<td>
<input id="quxiao" type="button" value="注册">
</td>
</tr>
</table>
</form>
<iframe name="hf"></iframe>
</BODY>
</HTML>
<!--#include file="conn.asp" -->
<%
s = ""
username = Trim(Request("name"))
username = Replace(username, "'", "''")
sql = "SELECT COUNT(*) FROM [users] WHERE [username]='" & username & "'
Set rs = CreateObject("ADODB.RecordSet")
rs.cursorLocation = 3
rs.open sql,conn,1,1
If rs(0)= 0 Then
s = "不存在"
Else
s = "存在"
End If
rs.close
set rs = nothing
conn.close
set conn = nothing
%>
<script>
window.onload=function(){
parent.document.getElementById("pad").innerHTML = "<%=s%>";
location.replace("about:blank");
}
</script>
name = Request.Form("name")
Set Rs = conn.Execute("Select 1 From [tablename] where name='"&name &"' ")
If Not Rs.Eof Then
Response.write "不存在"
Else
Response.write "存在"
End If