【正文】
[3] 李世杰. Active Server Pages 網(wǎng)頁設(shè)計(jì)手冊 [M].北京:清華大學(xué)出版社,2000[4] 清源計(jì)算機(jī)工作室編. ASP動態(tài)網(wǎng)站設(shè)計(jì)與設(shè)計(jì) [M]. 機(jī)械工業(yè)出版社,2001[5] 燈文淵,陳惠珍. ASP與網(wǎng)頁數(shù)據(jù)庫設(shè)計(jì) [M]. 中國鐵道出版社,2001附錄A (程序清單)程序清單:部分程序 程序清單:script runat=server language=vbscriptsub application_onstartend subsub session_onstartsession(artech)= ‘//用來判斷顧客是否已登陸redim arrcart(50,3) //用來表示購物車的二維數(shù)組session(mycart)=arrcartsession(cartindex)=cint(0) 39。//指示當(dāng)前購物車數(shù)組中的物品的指針session(huiyuanjia)=cint(0)session(role)end subsub session_onendset session(artech)=nothingsession(role)=nothingsession(huiyuanjia)=nothingend sub/script (部分程序清單)%dim arrcart,cartindex,i,htmlcode,tota10,total1arrcart=session(mycart)cartindex=session(cartindex)count=0for i=0 to cartindex if arrcart(i,2) then if arrcart(i,2)0 then count=count+1 end if end ifnextif count=0 then htmlcode=您的購物車是空的! htmlcode=htmlcodeamp。a href=amp。lt。amp。lt。back/a htmlcodeelse …………… (顯示購物車的內(nèi)容)(部分程序清單)content=trim(request(content))……pinglunname=trim(request(pinglunname))Set rs=()sql=select * from shop_pinglun sql,conn,1,3rs(pinglunhuifu)=contentrs(pinglunname )=pinglunname(部分程序清單):pinglunid=request(pinglunid)return=request(huifu)set rs=()sql=select * from shop_pinglun where pinglunid=amp。pinglunid sql,conn,1,3if not( and ) then rs(shenhe)=* rs(huifu)=return(部分代碼清單):set rs=()sql=select * from shop_pinglun sql,conn,1,1 //打開數(shù)據(jù)庫;td height=30 align=center%=rs(pinglunid)%/td(部分代碼清單):Set rs=()sql=Select * from shop_pinglun where pinglunid=amp。request(pinglunid) sql,conn,1,3if not( and ) thensql=delete * from shop_pinglun where pinglunid=amp。request(pinglunid)(sql)檢測輸入:當(dāng)用戶輸入用戶名和密碼以后。(部分代碼清單)if not( and )then if password=rs(password) then if rs(quanxian)=guanli then session(role)=rs(quanxian) session(artech)=request(username) elseif rs(quanxian)=boss then session(role)=rs(quanxian) session(artech)=request(username) else session(role)=rs(quanxian) session(artech)=request(username) session(id)=rs(id)會員刪除代碼dim idim t(10)for i=0 to 9 if t(i) then sql=delete * from user where id=amp。t(i) (sql) end if判斷id號,刪除用戶當(dāng)填完整商品的全部信息后,就要按添加按鈕。當(dāng)按下這個按鈕后會觸發(fā)一個事件,部分代碼如下:form method=post action= name=form1 onSubmit=javascript:return check()。td height=40 align=centerinput name=id type=text value= size=15 maxlength=10 /td (部分代碼清單):id=LCase(Request(id)) ……set rs=()sql=select * from shop where id=amp。id sql,conn,1,1if not thenscript language=javascriptalert(39。該編號已存在!39。)。其中id=LCase(Request(id)) 是從表單中把內(nèi)容復(fù)給臨時變量id,通過id來操作。當(dāng)打開數(shù)據(jù)庫后,rs(“id”)=id 是把從表單中得到的新值復(fù)給shop表中相對應(yīng)的id 字段,最后,1 (部分代碼清單):id=(index) sql=delete * from shop where id=amp。id (sql)1商品修改(部分代碼清單):d=LCase((id))productname=LCase((productname))picture=LCase((picture))……得到表單中的新內(nèi)容。rs(id)=idrs(picture)=picture…… 更新數(shù)據(jù)。telephone=LCase(Request(telephone))occupation=LCase(Request(occupation))......得到用戶的信息;Set rs=() Select * from user where username=39。amp。usernameamp。39。,connif not thenfont color=reddiv align=centerbrbr該用戶名已存在/div/font附錄B (附錄B題目)(附錄B內(nèi)容)