《管理員登錄系統(tǒng)》由會員分享,可在線閱讀,更多相關《管理員登錄系統(tǒng)(16頁珍藏版)》請在裝配圖網上搜索。
1、管理員登錄系統(tǒng)
第一!?。。?!
1,(index.asp 用戶登陸頁面)
!-- #include file=conn.asp --
!-- 悠悠長假期 --
html
head
meta http-equiv=Content-Type content=text/html; charset=gb2312
title會員/title
style type=text/css
!--
body,td,th {
font-family: 宋體;
font-size: 14px;
2、 }
--
/style
/head
body
center
p會員注冊系統(tǒng)/p
form name=form1 method=post action=login.asp
table width=34% border=0
tr
td width=33% height=30用戶名:/td
td width=67% height=30input name=username type=text id=username size=15/td
/tr
tr
td height=30密 碼:/td
td height=30input name=p
3、assword type=password id=password size=15/td
/tr
tr
td colspan=2 align=centerinput type=submit name=Submit value=確定
input type=reset name=Submit value=重置/td
/tr
tr
td colspan=2a href=reg.asp target=_self注冊/a/td
/tr
/table
/form
/center
/body
/html
2,(login.asp 用戶數據處理文件)
4、
!-- #include file=conn.asp --
%
打開數據庫判斷用戶是否存在,info為表名,username為字段名
set rsc=server.createobject(adodb.recordset)
sqlc=select * from info where username=request.Form(username) and password=request.Form(password)
rsc.open sqlc,conn,1,1
session(username)=rsc(username)
session(password)=r
5、sc(password)
session.Timeout=30
set rsc=nothing
response.Redirect(change.asp)
如果用戶不存在,session(username)為空
%
3,(change.asp 用戶信息修改頁面)
!-- #include file=conn.asp --
html
head
meta http-equiv=Content-Type content=text/html; charset=gb2312
title修改/title
style type=text/css
!--
6、 body,td,th {
font-size: 14px;
}
--
/style/head
center
body
br
%
set rsc=server.createobject(adodb.recordset)
sqlc=select * from info where username=session(username) and password=session(password)
rsc.open sqlc,conn,1,1
nr=rsc(password)
username=rsc(username)
password=r
7、sc(password)
sex=rsc(sex)
qq=rsc(qq)
mail=rsc(mail)
add=rsc(add)
personalinfo=rsc(personalinfo)
vv=rsc(ntime)
set rsc=nothing
if nr= then
response.Redirect(index.asp)
end if
if strcomp(nr,request.Form(password))=0 then
response.Write(歡迎你!request.Form(username))
response.Wri
8、te(你是在vv注冊的)
session(username)=request.Form(username)
end if
if session(username)= then
response.Redirect(index.asp)
end if
%
form name=form1 method=post action=change.asp?ac=ch
table width=39% height=105 border=0
tr
td width=27% height=30用戶名:/td
td width=73% height=30input na
9、me=username type=text id=username value=%=username%
*/td
/tr
tr
td height=30密nbsp; 碼:/td
td height=30input name=password type=text id=password value=%=password%
*/td
/tr
tr
td height=30性nbsp; 別:/td
td height=30input name=sex type=text id=sex value=%=sex%/td
/tr
tr
td height
10、=30QQ:/td
td height=30input name=qq type=text id=qq value=%=qq%/td
/tr
tr
td height=30Mail:/td
td height=30input name=mail type=text id=mail value=%=mail%/td
/tr
tr
td height=30地nbsp; 址:/td
td height=30input name=add type=text id=add value=%=add%/td
/tr
tr
td介紹/td
tdtextare
11、a name=personalinfo cols=30 rows=6 id=personalinfo%=personalinfo%/textarea/td
/tr
tr
td /td
tdinput type=submit name=Submit value=修改
a href=change.asp?se=y target=_self退出系統(tǒng)/a/td
nbsp; % if strcomp(request.QueryString(se),y)=0 then
nbsp; session(username)=
nbsp; response.Redirect(inde
12、x.asp)
nbsp; end if
nbsp; %
/tr
/table
/form
%
if strcomp(request.QueryString(ac),ch)=0 then
set rs=server.createobject(adodb.recordset)
sql=select * from info where username=session(username)
rs.open sql,conn,1,3
rs(username)=request.Form(username)
rs(password)=request.Form(
13、password)
rs(mail)=request.Form(mail)
rs(sex)=request.Form(sex)
rs(qq)=request.Form(qq)
rs(add)=request.Form(add)
rs(personalinfo)=request.Form(personalinfo)
rs.update
set rs=nothing
response.Write(修改完成!)
end if
%
/body
/center
/html
4,(reg.asp 新用戶注冊頁面)
html
head
me
14、ta http-equiv=Content-Type content=text/html; charset=gb2312
title用戶注冊/title
style type=text/css
!--
body,td,th {
font-family: 宋體;
font-size: 14px;
}
--
/style
/head
body
center
用戶注冊br
%
=request.QueryString(msg)
%
form name=form1 method=post action=addnewdata.asp
15、?ac=adduser
table width=39% height=105 border=0
tr
td width=27% height=30用戶名:/td
td width=73% height=30input name=username type=text id=username
*/td
/tr
tr
td height=30密碼:/td
td height=30input name=password type=password id=password
*/td
/tr
tr
td height=30確定密碼:/td
td h
16、eight=30input name=password2 type=password id=password2
*/td
/tr
tr
td height=30性別:/td
td height=30input name=sex type=text id=sex/td
/tr
tr
td height=30QQ:/td
td height=30input name=qq type=text id=qq/td
/tr
tr
td height=30Mail:/td
td height=30input name=mail type=text id=
17、mail/td
/tr
tr
td height=30地址:/td
td height=30input name=add type=text id=add/td
/tr
tr
td個人介紹/td
tdtextarea name=personalinfo cols=30 rows=6 id=personalinfo/textarea/td
/tr
tr
td /td
tdinput type=submit name=Submit value=提交/td
/tr
/table
/form
/center
/body
/html
18、
5,(addnewdata.asp 新用戶注冊數據處理文件)
!-- #include file=conn.asp --
html
head
meta http-equiv=Content-Type content=text/html; charset=gb2312
title成功/title
/head
body
%
ac=request.QueryString(ac)
msg=注冊錯誤信息
if request.Form(username)= then
msg=msgbr用戶名不能為空
end if
if strcomp(cst
19、r(request.Form(password)),cstr(request.Form(password2)))0 then
msg=msgbr兩次密碼輸入不同
end if
if len(request.Form(password))6 then
msg=msgbr密碼太簡單
end if
if strcomp(msg,注冊錯誤信息)0 then
response.Redirect(reg.asp?msg=msg)
end if
if ac=adduser then
set rsc=server.createobject(adodb.records
20、et)
sql=select * from info where username=request.Form(username)
rsc.open sql,conn,1,1
ck=rsc(username)
set rsc=nothing
if ck then
msg=msgbr用戶名被人注冊
response.Redirect(reg.asp?msg=msg)
end if
dsql=select * from info where id is null
set rs=server.createobject(adodb.recordset)
rs.
21、open dsql,conn,1,3
rs.addnew
rs(username)=request.Form(username)
rs(password)=request.Form(password)
rs(mail)=request.Form(mail)
rs(sex)=request.Form(sex)
rs(qq)=request.Form(qq)
rs(add)=request.Form(add)
rs(personalinfo)=request.Form(personalinfo)
rs(ntime)=now
rs.update
set r
22、s=nothing
%
center
a href=index.asp target=_self注冊成功,點擊登陸/a
/center
%
end if
%
/body
/html
6,(conn.asp 數據庫連接文件)
%
連接數據庫開始
dim conn,rs,sql
on error resume next
dbpath=server.mappath(userinfo.mdb)
set conn=server.createobject(adodb.connection)
conn.open PROVIDER=Microsoft.jet.OLEDB.4.0;data source=dbpath
創(chuàng)建記錄對象
set rs=server.createobject(adodb.recordset)
%
7,(userinfo.mdb ACCESS 數據庫)
在ACCESS中建一個表,然后在這個表中建立字段名稱
表名:info
字段名稱 數據類型
id 自動編號
username 文本
password 文本
sex 文本
quest 文本
qq 文本
mail 文本
personalinfo 文本
ntime 文本