《管理員登錄系統(tǒng)》由會員分享,可在線閱讀,更多相關《管理員登錄系統(tǒng)(16頁珍藏版)》請在裝配圖網(wǎng)上搜索。
1、管理員登錄系統(tǒng) 第一!1,(index.asp 用戶登陸頁面)!- #include file=conn.asp -!- 悠悠長假期 -htmlheadmeta http-equiv=Content-Type content=text/html; charset=gb2312title會員/titlestyle type=text/css!-body,td,th font-family: 宋體; font-size: 14px;-/style/headbodycenterp會員注冊系統(tǒng)/pform name=form1 method=post action=login.asptable wid
2、th=34% border=0trtd width=33% height=30用戶名:/tdtd width=67% height=30input name=username type=text id=username size=15/td/trtrtd height=30密 碼:/tdtd height=30input name=password type=password id=password size=15/td/trtrtd colspan=2 align=centerinput type=submit name=Submit value=確定input type=reset nam
3、e=Submit value=重置/td/trtrtd colspan=2a href=reg.asp target=_self注冊/a/td/tr/table/form/center/body/html2,(login.asp 用戶數(shù)據(jù)處理文件) !- #include file=conn.asp -%打開數(shù)據(jù)庫判斷用戶是否存在,info為表名,username為字段名set rsc=server.createobject(adodb.recordset)sqlc=select * from info where username=request.Form(username) and pas
4、sword=request.Form(password)rsc.open sqlc,conn,1,1session(username)=rsc(username)session(password)=rsc(password)session.Timeout=30set rsc=nothingresponse.Redirect(change.asp)如果用戶不存在,session(username)為空%3,(change.asp 用戶信息修改頁面)!- #include file=conn.asp -htmlheadmeta http-equiv=Content-Type content=tex
5、t/html; charset=gb2312title修改/titlestyle type=text/css!-body,td,th font-size: 14px;-/style/headcenterbodybr%set rsc=server.createobject(adodb.recordset)sqlc=select * from info where username=session(username) and password=session(password)rsc.open sqlc,conn,1,1nr=rsc(password)username=rsc(username)p
6、assword=rsc(password)sex=rsc(sex)qq=rsc(qq)mail=rsc(mail)add=rsc(add)personalinfo=rsc(personalinfo)vv=rsc(ntime)set rsc=nothingif nr= thenresponse.Redirect(index.asp)end ifif strcomp(nr,request.Form(password)=0 thenresponse.Write(歡迎你!request.Form(username)response.Write(你是在vv注冊的)session(username)=re
7、quest.Form(username)end ifif session(username)= thenresponse.Redirect(index.asp)end if%form name=form1 method=post action=change.asp?ac=chtable width=39% height=105 border=0 trtd width=27% height=30用戶名:/tdtd width=73% height=30input name=username type=text id=username value=%=username%*/td/trtrtd he
8、ight=30密nbsp; 碼:/tdtd height=30input name=password type=text id=password value=%=password%*/td/trtrtd height=30性nbsp; 別:/tdtd height=30input name=sex type=text id=sex value=%=sex%/td/trtrtd height=30QQ:/tdtd height=30input name=qq type=text id=qq value=%=qq%/td/trtrtd height=30Mail:/tdtd height=30in
9、put name=mail type=text id=mail value=%=mail%/td/trtrtd height=30地nbsp; 址:/tdtd height=30input name=add type=text id=add value=%=add%/td/trtrtd介紹/tdtdtextarea name=personalinfo cols=30 rows=6 id=personalinfo%=personalinfo%/textarea/td/trtrtd /tdtdinput type=submit name=Submit value=修改a href=change.a
10、sp?se=y target=_self退出系統(tǒng)/a/tdnbsp; % if strcomp(request.QueryString(se),y)=0 thennbsp; session(username)=nbsp; response.Redirect(index.asp)nbsp; end ifnbsp; %/tr/table/form%if strcomp(request.QueryString(ac),ch)=0 thenset rs=server.createobject(adodb.recordset)sql=select * from info where username=s
11、ession(username)rs.open sql,conn,1,3rs(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.updateset rs=nothingresponse.Write(修改完成!)end if%
12、/body/center/html4,(reg.asp 新用戶注冊頁面)htmlheadmeta http-equiv=Content-Type content=text/html; charset=gb2312title用戶注冊/titlestyle type=text/css!-body,td,th font-family: 宋體; font-size: 14px;-/style/headbodycenter用戶注冊br%=request.QueryString(msg)%form name=form1 method=post action=addnewdata.asp?ac=adduse
13、rtable width=39% height=105 border=0 trtd width=27% height=30用戶名:/tdtd width=73% height=30input name=username type=text id=username*/td/trtrtd height=30密碼:/tdtd height=30input name=password type=password id=password*/td/trtrtd height=30確定密碼:/tdtd height=30input name=password2 type=password id=passwo
14、rd2*/td/trtrtd height=30性別:/tdtd height=30input name=sex type=text id=sex/td/trtrtd height=30QQ:/tdtd height=30input name=qq type=text id=qq/td/trtrtd height=30Mail:/tdtd height=30input name=mail type=text id=mail/td/trtrtd height=30地址:/tdtd height=30input name=add type=text id=add/td/trtrtd個人介紹/tdt
15、dtextarea name=personalinfo cols=30 rows=6 id=personalinfo/textarea/td/trtrtd /tdtdinput type=submit name=Submit value=提交/td/tr/table/form/center/body/html5,(addnewdata.asp 新用戶注冊數(shù)據(jù)處理文件)!- #include file=conn.asp -htmlheadmeta http-equiv=Content-Type content=text/html; charset=gb2312title成功/title/head
16、body%ac=request.QueryString(ac)msg=注冊錯誤信息if request.Form(username)= thenmsg=msgbr用戶名不能為空end ifif strcomp(cstr(request.Form(password),cstr(request.Form(password2)0 thenmsg=msgbr兩次密碼輸入不同end if if len(request.Form(password)6 thenmsg=msgbr密碼太簡單end if if strcomp(msg,注冊錯誤信息)0 thenresponse.Redirect(reg.asp
17、?msg=msg)end ifif ac=adduser thenset rsc=server.createobject(adodb.recordset)sql=select * from info where username=request.Form(username)rsc.open sql,conn,1,1ck=rsc(username)set rsc=nothingif ck thenmsg=msgbr用戶名被人注冊response.Redirect(reg.asp?msg=msg)end ifdsql=select * from info where id is nullset r
18、s=server.createobject(adodb.recordset)rs.open dsql,conn,1,3rs.addnewrs(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)=nowrs.upd
19、ateset rs=nothing%centera href=index.asp target=_self注冊成功,點擊登陸/a/center%end if%/body/html6,(conn.asp 數(shù)據(jù)庫連接文件)%連接數(shù)據(jù)庫開始dim conn,rs,sqlon error resume nextdbpath=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 數(shù)據(jù)庫)在ACCESS中建一個表,然后在這個表中建立字段名稱表名:info字段名稱 數(shù)據(jù)類型id 自動編號username 文本password 文本sex 文本quest 文本qq 文本mail 文本personalinfo 文本ntime 文本