5185092920网页设计课程设计报告—电子商务网站开发与建设.doc

上传人:文库蛋蛋多 文档编号:2880968 上传时间:2023-03-01 格式:DOC 页数:25 大小:2.51MB
返回 下载 相关 举报
5185092920网页设计课程设计报告—电子商务网站开发与建设.doc_第1页
第1页 / 共25页
5185092920网页设计课程设计报告—电子商务网站开发与建设.doc_第2页
第2页 / 共25页
5185092920网页设计课程设计报告—电子商务网站开发与建设.doc_第3页
第3页 / 共25页
5185092920网页设计课程设计报告—电子商务网站开发与建设.doc_第4页
第4页 / 共25页
5185092920网页设计课程设计报告—电子商务网站开发与建设.doc_第5页
第5页 / 共25页
点击查看更多>>
资源描述

《5185092920网页设计课程设计报告—电子商务网站开发与建设.doc》由会员分享,可在线阅读,更多相关《5185092920网页设计课程设计报告—电子商务网站开发与建设.doc(25页珍藏版)》请在三一办公上搜索。

1、课程设计电子商务网站开发与建设 姓 名: 学 号: 专 业: 指导教师: 联系方式: 2013年06 月 14 日一、书店首页实现代码:圆圆书店欢迎来到圆圆书店!首页用户登录用户注册购物车 自然类 历史类 文学类 艺术类 数学类 政治类 地理类 天文类 漫画类 TOP 1 TOP2 TOP3 实现效果:二、 数据库购物车数据库会员信息数据库图书信息数据库订单信息数据库数据库连接语句三、登录页面代码:用户登录圆圆书店!亲,先登录吧!用户名:登录密码:实现效果:四、注册界面代码: sub check dim theForm set theForm=document.MyForm if theFor

2、m.username.value= then MsgBox 用户名不能为空! exit sub end ifif len(theform.username.value)20 then msgbox 用户名必须在6-20个字符和数字之间! exit sub end ifif len(theform.password.value)20 then msgbox 密码必须为6-20个字符和数字之间! exit subend ifif theform.password.valuetheform.repassword.value then msgbox 再次输入密码必须与以上相同! exit sub en

3、d if if theForm.question.value= then MsgBox 问题不能为空! exit sub end if if theForm.answer.value= then MsgBox 答案不能为空! exit sub end if if theForm.firstname.value= then MsgBox 姓名不能为空! exit sub end if if theForm.phonenumber.value= then MsgBox 联系方式不能为空! exit sub end if dim pos,txt,atxt=theForm.email.valuepos

4、=a=instr(txt,pos)if a=0 then msgbox电子邮箱地址不正确! exit sub end iftheForm.submit end sub用户注册欢迎光临圆圆书店!先注册吧,成为我们的会员! 标注*项为必填选项 请输入您的用户名。 用户名指南 必须为620个字符 用户名:* 请输入您的用户登录密码。 密码指南 请输入620个字符或数字。 密码:* 请再次输入密码:* 请输入密保问题和密码。 密保问题指南 这些问题将在你忘记用户名或密码的时候对你有所帮助。 问题:* ? 答案:* 请输入您的联系信息。 姓名:* 联系方式:* 电子邮箱:* 实现效果:输出注册结果代码:

5、 % dim username dim password dim question dim answer dim name dim phonenumber dim mail username=Request.form(username) password=Request.form(password) question=Request.Form(question) answer=Request.form(answer) name=Request.form(name) phonenumber=Request.form(phonenumber) mail=Request.form(mail) res

6、ponse.write response.write Username: response.write&username& response.write Password: response.write&password& response.write Question: response.write&question& response.write Answer: response.write&answer& response.write Name: response.write&name& response.write PhoneNumber: response.write&phonenu

7、mber& response.write E-mail: response.write&mail& response.write % 虚拟目录建立步骤(1)在计算机管理建立虚拟目录(2)创建虚拟目录名称、并浏览HTML存放的文件(3)通过虚拟目录浏览文件(4) 注册信息填写并提交用户登录(检查用户登录信息是否正确di.asp)% set conn=server.createobject(ADODB.connection) strprovider=driver=microsoft access driver (*.mdb);DBQ= &server.mappath(liyuanyuan.mdb)

8、 Set Rs=Server.CreateObject(ADODB.Recordset) username=Request(username) password=Request(password) if len(username)6 then checkpass=false if len(password)五、购物车界面 往购物车里添加商品:当单击商品信息页面中的“加入购物车”按钮后,就会调用“Cart.asp”页面,同时传递当前商品的编号。“Cart.asp”页面接受商品编号以后,把该商品信息添加到购物车信息数据库表中,然后显示当前的购物车商品。添加时使用Insert into语句,用法如下

9、:Sql=Insert into Cartitem(CartID,ProductID,&_ProductQuantity) value(&CartID&,&ProductID&_,&ProductQuantity&) Cart.asp完整代码如下:%dim UserID,ProductID,ProductQuantity.ProductPrice,CartIDUserID=session(UserID)If UserID=thenResponse.write对不起,你还没有登录,所以不能订购商品。&_如果你已经注册,请按这里登录。&_如果没有,请按这里注册。Set conn=nothingRe

10、sponse.endProductID=request.form(ProductID)ProductPrice=request.form(ProductPrice)ProductQuantity=1set rsCart=server.createobject(adodb.recordset)Sql=select*form Carts where UserID=&UserIDrsCart.open sql,conn,3,2If reCart.eof and reCart.bof thenrsCart.addnewrsCart(UserID)=UserIDrsCart.updateEnd ifrs

11、Cart.MoveLastCartID=rsCart(CartID)rsCart.closeSet rsCart=nothingSet rsItem=server.createobject(adodb.recordset)If ProductIDthenSql=delete from cartitem where cartid=&cartID&_and ProductID=&ProductIDConn.execute sqlSql=Insert into CartItem(CartID,ProductID,&_ProductQuantity,ProductPrice)value(&CartID

12、&,&ProductID&_,&ProductQuantity &,&ProductPrice&)Conn.execute sqlEnd ifSql=select CartItem.CartID,CartItem.ProductID,CartItem.ProductQuantity,&_Products.ProductPrice,Products.ProductName&_from CartItem,Products&_where CartItem.ProductID=Products.ProductID and&_CartItem.CartID=&CartID&_order by CartI

13、tem.ProductIDrsItem.open sql,conn,0,1%欢迎光临购物车input type=hidden name=CartID value=购物车序号商品数量单价金额%end ifinput type=text size=3 name=PQValue=input type=checkbox name=PD value=1合计input type=hidden name=CartID value=.实现效果:点击图书致青春详情表下面的“加入购物车”按钮,出现如下页面(其代码在下面图书详情代码中再详细给出):数据库如下:六、分类检索-以文学类为例代码:圆圆书店圆圆书店 文学类

14、 致我们终将逝去的青春平版 谁杀了我的牛? 妙语人生   实现结果:点击致青春的书名或图片。其代码及实现页面如下代码:圆圆书店圆圆书店 致我们终将逝去的青春(附珍藏卡册) 平装 作者:辛夷坞 价格:¥ 15 免运费 库存数量:2件 图书描述 郑微,心怀对林静的爱意考上林静所在城市大学,发现林静已出国,后爱上同校陈孝正,一个板正又敏感的男孩。两个人走到一起,陈孝正却选择出国,放弃郑微。几年后,林静陈孝正出现,郑微会倾向于哪边呢? 出版社: 百花洲文艺出版社; 第1版 (2013年5月1日) 平装: 298页 语种: 简体中文商品尺寸: 23.6 x 16.8 x 2.4 c H2 align=left class=

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号