您的位置:首页精文荟萃软件资讯 → 网上“店铺”DIY3

网上“店铺”DIY3

时间:2004/10/7 19:18:00来源:本站整理作者:蓝点我要评论(0)

Buy.asp









购货蓝















网上书店


src="file://C:\InetPub\wwwroot\images\title.jpg">
















<%



function ID(mystr)



pos=0



for i=1 to len(mystr)



if mid(mystr,i,1)="`" then



if pos=0 then



ID=left(mystr,i-1)



exit for



end if



end if



next



end function



function BookName(mystr)



pos=0



for i=1 to len(mystr)



if mid(mystr,i,1)="`" then



if pos=0 then



pos=pos+1



else



BookName=mid(mystr,len(id(name))+2,i-2-len(id(name)))



exit for



end if



end if



next



end function



function Price(mystr)



for i= len(mystr) to 1 step -1



if mid(mystr,i,1)="`" then



if pos=0 then



Price=right(mystr,len(mystr)-i)



exit for



end if



end if



next



end function



select case request.querystring("Name")



case "view"



response.write "浏览"



if session("num")="" then



response.write "目前购货蓝中没有选中的书目!"



else



num=clng(session("num"))



response.write ""



session("sum")=0



for i=0 to num



session("sum")=session("sum")+session("sum_" & cstr(i))



response.write ""



next



response.write "
书号书名单价

数量小计
" & session("ID_" & cstr(i)) & "" &

session("BookName_" & cstr(i)) & "
" & session("price_" & cstr

(i)) & "

value=" & session("num_" & cstr(i)) & ">
" & session("sum_" & cstr

(i)) & "
"



Response.Write "购货总金额:" & session("sum")



end if



case ""



response.write "本页内修改"



num=clng(session("num"))



for i=0 to num



session("num_" & cstr(i))=(request.form("txtNum" & cstr(i)))



session("sum_" & cstr(i))=session("num_" & cstr(i))*session("price_"

& cstr(i))



next



response.write ""



session("sum")=0



for i=0 to num



session("sum")=session("sum")+session("sum_" & cstr(i))



response.write ""



next



response.write "
书号书名单价

数量小计
" & session("ID_" & cstr(i)) & "" &

session("BookName_" & cstr(i)) & "
" & session("price_" & cstr

(i)) & "

value=" & session("num_" & cstr(i)) & ">
" & session("sum_" & cstr

(i)) & "
"



Response.Write "购货总金额:" & session("sum")



case else



response.write "增加"



if session("num")="" then



session("num")=0



else



session("num")=clng(session("num"))+1



end if



num=clng(session("num"))



name=(request.querystring("Name"))



session("ID_" & cstr(num))=id(name)



session("Bookname_" & cstr(num))=bookname(name)



session("price_" & cstr(num))=price(name)



session("sum_" & cstr(num))=price(name)



session("num_" & cstr(num))=1



response.write ""



session("sum")=0



for i=0 to num



session("sum")=session("sum")+session("sum_" & cstr(i))



response.write ""



next



response.write "
书号书名单价

数量小计
" & session("ID_" & cstr(i)) & "" &

session("BookName_" & cstr(i)) & "
" & session("price_" & cstr

(i)) & "

value=" & session("num_" & cstr(i)) & ">
" & session("sum_" & cstr

(i)) & "
"



Response.Write "购货总金额:" & session("sum")



end select



%>




>">

















其运行界面如下:



在下面有总金额的显示,并且购买的数量可以更改。



In.asp

<%@ Language=VBScript %>



<%



if Request.Form("txtUser")="" or Request.Form("txtPWD")="" then



Response.Write "用户名或密码为空,请重新输入,如果您没有注册,请选择注

册!"



else



set rs=server.CreateObject("ADODB.recordset")



rs.Open "select * from info where ID='" & Request.Form("txtUser")

& "'" ,"DSN=sqlsales;UID=sa",3,3



if rs.RecordCount =0 then



Response.Write "此会员号不存在!"



else



if trim(rs.Fields("PWD"))<>trim(Request.Form("txtPWD")) then



Response.Write "密码不正确!"



Response.Write rs.Fields("ID") & "
"



Response.Write rs.Fields("PWD") & "
"



Response.Write Request.Form("txtPWD")



else



session("UserID")=rs.Fields("ID")



session("UserName")=rs.Fields("Name")



Response.Redirect "index.asp"



'Response.Write rs.Fields("ID") & "
"



'Response.Write rs.Fields("PWD") & "
"



'Response.Write "欢迎光临!"



end if



end if



rs.Close



end if



%>































此段程序用于检测登录的合法性。



Registry.asp

<%@ Language=VBScript %>



<%



if Request.Form("txtID")="" and Request.Form("txtPWD")="" and

Request.Form("txtPWD1")="" and _



Request.Form("txtname")="" and Request.Form("txtSFZ")="" and

Request.Form("txtemail")="" and _



Request.Form("txtAdd")="" and Request.Form("txtPost")="" and

Request.Form("txtPhone")="" then



Response.Write "请认真填写以下内容:"



else



if Request.Form("txtID")="" then



Response.Write "用户名为空,请重新填写!" & "
"



elseif Request.Form("txtPWD")="" then



Response.Write "密码为空,请重新填写!" & "
"



elseif Request.Form("txtPWD1")="" then



Response.Write "密码校验为空,请重新填写!" & "
"



elseif Request.Form("txtName")="" then



Response.Write "姓名为空,请重新填写!" & "
"



elseif Request.Form("txtAdd")="" then



Response.Write "联系地址为空,请重新填写!" & "
"



elseif Request.Form("txtPost")="" then



Response.Write "邮政编码为空,请重新填写!" & "
"



elseif trim(Request.Form("txtPWD"))<>trim(Request.Form("txtPWD1"))

then



Response.Write "密码位与校验位不一致,请重新输入!" & "
"



else



set rs=server.CreateObject("ADODB.Recordset")



rs.Open "select * from info where ID='" & trim(Request.Form("txtID"))

& "'" ,"DSN=sqlsales;UID=sa;",3,3



'rs.Open "select * from info where ID=" & chr(34) & "yuaiwu" & chr

(34) ,"DSN=sqlsales;UID=sa;",3,3



if rs.RecordCount <>0 then



Response.Write "此用户已经登记,请选择别的用户名:"



else



dim fld(7)



dim value(7)



fld(0)="ID"



fld(1)="name"



fld(2)="PWD"



fld(3)="Email"



fld(4)="address"



fld(5)="phone"



fld(6)="post"



fld(7)="sfz"



value(0)=Request.Form("txtID")



value(1)=Request.Form("txtname")



value(2)=Request.Form("txtpwd")



value(3)=Request.Form("txtEmail")



value(4)=Request.Form("txtadd")



value(5)=Request.Form("txtphone")



value(6)=Request.Form("txtPost")



value(7)=Request.Form("txtSFZ")



rs.AddNew fld,value



rs.Update



end if



rs.Close



end if



end if



%>























会 员 申 请





























































































































用户名


style="HEIGHT: 22px; WIDTH: 275px">**
密码


type=password



style="HEIGHT: 22px; WIDTH: 274px">**
确认


type=password



style="HEIGHT: 22px; WIDTH: 275px">**
姓名


style="HEIGHT: 22px; WIDTH: 274px">**
身份证号码


style="HEIGHT: 22px; WIDTH: 274px">
Email


style="HEIGHT: 22px; WIDTH: 273px">
联系地址:


style="HEIGHT: 22px; WIDTH: 272px">**
邮政编码:


name=txtPost



style="HEIGHT: 22px; WIDTH: 270px">**
联系电话:


style="HEIGHT: 22px; WIDTH: 270px">






认>





请注意:









  • 带有 ** 号的栏目是必须填写的,其他的栏目可以不





  • 以上信息应如实填写,以便我们能与您取得及时的联





&nbsp;













这个登录界面和大多数网上的登录新用户类似。



小结:

 



    几个程序都做了一个简要地说明,当然,程序做地非常简单,还有很多功能没有

或有待完美,但它却示范了一个简单的范例,在此仅供大家参考。如果大家有兴趣,

可以把上面的程序试一下,祝大家成功!




相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么

文章评论
发表评论

热门文章 360快剪辑怎么使用 36金山词霸如何屏幕取词百度收购PPS已敲定!3

最新文章 微信3.6.0测试版更新了微信支付漏洞会造成哪 360快剪辑怎么使用 360快剪辑软件使用方法介酷骑单车是什么 酷骑单车有什么用Apple pay与支付宝有什么区别 Apple pay与贝贝特卖是正品吗 贝贝特卖网可靠吗

人气排行 xp系统停止服务怎么办?xp系统升级win7系统方电脑闹钟怎么设置 win7电脑闹钟怎么设置office2013安装教程图解:手把手教你安装与qq影音闪退怎么办 QQ影音闪退解决方法VeryCD镜像网站逐个数,电驴资料库全集同步推是什么?同步推使用方法介绍QQ2012什么时候出 最新版下载EDiary——一款好用的电子日记本