用戶注冊(cè)代碼asp(用戶注冊(cè)代碼java)
設(shè)login為登陸頁面login1為login所提交的頁面代碼驗(yàn)證頁面,login1里的代碼 開庫 lt!#include file=quotconnquot lt 先接login頁面的值 admin_name這個(gè)是用戶名=serverencodetrimrequestquotadmin_name這個(gè)是login的;1建立一個(gè)數(shù)據(jù)庫,名稱Servemdb,然后建立一個(gè)表UserInf,最后建立三個(gè)字段UserName用戶名,PassWord密碼,Address地址 2然后賦值下面的代碼,保存為一個(gè)頁面,例如regasp lt%@LANGUAGE=quotVBSCRIPTquot CODE。
用vbscript語言檢查用戶名符合要求再提交表單 ltsctipt language=vbscript sub button_onclick if lendocumentallquot用戶名的控件名quotlt你控制名的長(zhǎng)度 then mdgbox quot你的注冊(cè)用戶名過短,請(qǐng)從新輸入!quotexit sub else f;textquot name=quotuaddressquot ltfrom 注1connasp 為鏈接數(shù)據(jù)庫文件,不懂的再百度一下asp+access 數(shù)據(jù)庫鏈接方法 2假設(shè)字段名分別為unameusexuaddress。
rsopen sql,conn,1,3 if rsrecordcount 0 then responsewrite quotalert#39該用戶名已被注冊(cè)!#39historygo1quotresponseend #39注釋這里說明只要賬戶已被注冊(cè),就返回原頁面,然后responseend end if 改成這;If rsBOF Then 當(dāng)沒找到這個(gè)數(shù)據(jù)時(shí)應(yīng)該能注冊(cè) rsclose alertquot用戶 lt%=no1% 已經(jīng)被人使用!quot* windowlocation=quotwriter_to_accessaspquot* 而你上面的語句是說當(dāng)studentno=#39quot no1 quot#39quot, 為假時(shí)。
asp用戶注冊(cè)界面代碼
regasp注冊(cè)頁面lt!開始 lt!#include file=quot資料庫連接頁面aspquot 用戶名 密碼 性別 男 女 lt。
在當(dāng)前頁面目錄建立數(shù)據(jù)庫usernamemdb,再建個(gè)user表,根據(jù)注冊(cè)頁面內(nèi)容創(chuàng)建字段注冊(cè)頁registerasp如下 注冊(cè)頁面 lt! body margintop 0pxmarginbottom 0pxbackgroundimage urlbackgroundrepeat。
#39如果存在這個(gè)用戶名,對(duì)用戶進(jìn)行提示 responsewrite quot用戶名quot requestformquotf_userquot quot 已經(jīng)被占用請(qǐng)點(diǎn)擊后退按鈕返回上一頁quotrstclose set rst=nothing connclose set conn=nothing responseend else。
用戶注冊(cè)代碼html
1、如果 BOF 或 EOF 屬性為 True,則沒有當(dāng)前記錄if notrseof and rsbof 當(dāng)eof和bof 有且只一個(gè)為false的時(shí)候notrseof and rsbof 為true將會(huì)執(zhí)行 responsewritequot您注冊(cè)的用戶名已經(jīng)被注冊(cè)quot但是實(shí)際上。
2、在Button1_Click的方法體中寫注冊(cè)的代碼 1獲取用戶在頁面上錄入的值 string userName=string userPwd=2通過錄入的值拼湊一條insert語句所謂注冊(cè),就是給數(shù)據(jù)庫的用戶表。
3、#39regasp 用戶注冊(cè) lt! body,td,th fontfamily 宋體fontsize 14px 用戶注冊(cè) lt =requestQueryStringquotmsgquot。
4、用戶注冊(cè)functionChkFieldsif==quotquotaler 用戶注冊(cè) function ChkFields if ==quotquot alertquot請(qǐng)?zhí)顚懩拿艽a!quot。
5、#39第二個(gè)頁面registasp 用戶注冊(cè)頁面 lt!#include file=quotconnaspquot lt if lentrimrequestquotusernamequot6 and lentrimrequestquotpasswordquot6 then set rs=serverCreateObjectquotadodbrecordsetquot。
6、lt%@LANGUAGE=quotVBSCRIPTquot% lt!#include file=quotConnectionsshopaspquot lt Dim MM_editAction MM_editAction = CStrRequestServerVariablesquotSCRIPT_NAMEquotIf RequestQueryString lt quotquot Then MM_editAction。
7、注冊(cè)2,loginasp 用戶數(shù)據(jù)處理文件lt! #include file=quotconnaspquot lt%#39打開數(shù)據(jù)庫判斷用戶是否存在,info為表名,username為字段名set rsc=servercreateobjectquotadodbrecordsetquotsqlc=quotselect * from info where username=#39quot。
掃描二維碼推送至手機(jī)訪問。
版權(quán)聲明:本文由飛速云SEO網(wǎng)絡(luò)優(yōu)化推廣發(fā)布,如需轉(zhuǎn)載請(qǐng)注明出處。