ASP注册登陆代码2010/03/23 07:41数据库位置:data/data.mdb
数据库表:user
id
name
pwd
wenti
daanhtml中哪个选项能够表示空格
matlab极坐标轴labelconn.asp
<%
db="data/data.mdb" '数据库存放目录
on error resume next
set ateobject("tion")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath(db)
if err then
err.clear
set conn = nothing
response.write "数据库连接出错,请检查conn.asp中的连接字符串。"
d
end if
function closedb
html个人网页完整代码顺序conn.close
set conn=nothing
end function
%>
<%
dim badword
badword="'|and|select|update|chr|delete|%20from|;|insert|mid|master.|set|chr(37)|="
if request.querystring<>"" then
chk=split(badword,"|")
for each query_name in request.querystring
for i=0 to ubound(chk)
if instr(lcase(request.querystring(query_name)),chk(i))<>0 then
response.write "<script language=javascript>alert('传参错误!参数 "&query_name&" 的值中包含非法字符串!\n\n');location='"&request.servervariables("http_referer")&"'</script>"
d
discuz系统
end if
next
next
end if
%>
reg.asp
<%
if request("action")="reg" then
set ateobject("dset")
rs.open "select * from user where name='"&trim(request("name"))&"'",conn,1,1
dcount>0 then
response.write "<script language='javascript'>window.alert('您输入的用户名已存在,请返回重新输入!');history.back(-1);</script>"
d()
end if
sql="select * from user"
set ateobject("dset")
rs.open sql,conn,1,3
rs.addnew
rs("name")=trim(request.form("name"))
rs("pwd")=trim(request.form("pwd"))
rs("wenti")=trim(request.form("wenti"))
rs("daan")=trim(request.form("daan"))
rs.update
rs.close
set rs=nothing
response.write "<script language=javascript> alert('注册成功,点击确定立即登录!');place('login.asp');</script>"
d
end if
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0">
<tr>
<td>用户注册
<form name="form1" method="post" action="?action=reg" onsubmit="return chkform(this)">
<table width="347" border="1" cellpadding="5" cellspacing="0">
<tr>
<td width="142">用户名</td>
<td width="179"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td>密码</td>
<td><input name="pwd" type="password" id="pwd"></td>
</tr>
<tr>
<td>密码提示问题</td>
<td><input name="wenti" type="text" id="wenti"></td>
</tr>
<tr>
<td>密码提示答案</td>
<td><input name="daan" type="text" id="daan"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="注册">
<input type="reset" name="submit" value="重置"> </td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
top.asp
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0">
<tr>
<td><a href="/webjx/"";index.asp">首页</a>
<%
if session("name")="" then
%>
<a href="/webjx/"";reg.asp">注册</a> <a href="/webjx/"";login.asp">登陆</a>
<a href="/webjx/"";pwd.asp">忘记密码?</a> <%二叉树的遍历运行结果图
else
%>
欢迎您<%=session("name")%>, <a href="/webjx/"";loginout.asp">注销登陆</a>
<%
end if
%>
<a href="/webjx/"";jiami.asp">加密页</a></td>
</tr>
</table>
<br>
login.asp
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="90%" border="1" align="center" cellpadding="10" cellspacing="0">
<tr>
<td>
用户登陆
<%
if session("name")="" then
%>
<form name="form1" method="post" action="loginok.asp?action=login" onsubmit="return chkform(this)">
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<td width="116">用户名</td>
<td width="116"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td>密码</td>
<td><input name="pwd" type="password" id="pwd"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="登陆">
<input type="reset" name="submit" value="重置"></td>
</tr>
</table>
</form>
<%
else
%>
<table border="1" cellspacing="0" cellpadding="5">
<tr>
<td width="303"><%=session("name")%>,您已经成功登陆</td>
</tr>
</table>
<%
end if
%>
</td>
</tr>
</table>
</body>
</html>
typeof null的结果
loginok.asp
<%
session.timeout=30
if request("action")="login" then
name=trim(request.form("name"))
pwd=trim(request.form("pwd"))

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。