|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
asp对于服务器的要求较高,一般的服务器如果访问量一大就垮了,不得不重启。Buy.asp
<HTML>
<HEAD>
<title>购货蓝</title>
<METANAME="GENERATOR"Content="MicrosoftVisualStudio6.0">
</HEAD>
<BODYbgColor=lightcyan>
<Palign=center><br>
<BODYbgColor=lightcyan>
<formaction=buy.aspmethod=post>
<scriptlanguage=vbscript>
functionID(mystr)
pos=0
fori=1tolen(mystr)
ifmid(mystr,i,1)="`"then
ifpos=0then
ID=left(mystr,i-1)
exitfor
endif
endif
next
endfunction
</script>
<%
functionID(mystr)
pos=0
fori=1tolen(mystr)
ifmid(mystr,i,1)="`"then
ifpos=0then
ID=left(mystr,i-1)
exitfor
endif
endif
next
endfunction
functionBookName(mystr)
pos=0
fori=1tolen(mystr)
ifmid(mystr,i,1)="`"then
ifpos=0then
pos=pos+1
else
BookName=mid(mystr,len(id(name))+2,i-2-len(id(name)))
exitfor
endif
endif
next
endfunction
functionPrice(mystr)
fori=len(mystr)to1step-1
ifmid(mystr,i,1)="`"then
ifpos=0then
Price=right(mystr,len(mystr)-i)
exitfor
endif
endif
next
endfunction
selectcaserequest.querystring("Name")
case"view"
response.write"扫瞄"
ifsession("num")=""then
response.write"今朝购货蓝中没有选中的书目!"
else
num=clng(session("num"))
response.write"<tableborder=1><tr><td>书号</td><td>书名</td><td>单价
</td><td>数目</td><td>小计</td></tr>"
session("sum")=0
fori=0tonum
session("sum")=session("sum")+session("sum_"&cstr(i))
response.write"<tr><td>"&session("ID_"&cstr(i))&"</td><td>"&
session("BookName_"&cstr(i))&"</td><td>"&session("price_"&cstr
(i))&"</td><td><inputtype=textsize=5name=txtNum"&cstr(i)&"
value="&session("num_"&cstr(i))&"><td>"&session("sum_"&cstr
(i))&"</td></td></tr>"
next
response.write"</table>"
Response.Write"购货总金额:"&session("sum")
endif
case""
response.write"本页内修正"
num=clng(session("num"))
fori=0tonum
session("num_"&cstr(i))=(request.form("txtNum"&cstr(i)))
session("sum_"&cstr(i))=session("num_"&cstr(i))*session("price_"
&cstr(i))
next
response.write"<tableborder=1><tr><td>书号</td><td>书名</td><td>单价
</td><td>数目</td><td>小计</td></tr>"
session("sum")=0
fori=0tonum
session("sum")=session("sum")+session("sum_"&cstr(i))
response.write"<tr><td>"&session("ID_"&cstr(i))&"</td><td>"&
session("BookName_"&cstr(i))&"</td><td>"&session("price_"&cstr
(i))&"</td><td><inputtype=textsize=5name=txtNum"&cstr(i)&"
value="&session("num_"&cstr(i))&"><td>"&session("sum_"&cstr
(i))&"</td></td></tr>"
next
response.write"</table>"
Response.Write"购货总金额:"&session("sum")
caseelse
response.write"增添"
ifsession("num")=""then
session("num")=0
else
session("num")=clng(session("num"))+1
endif
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"<tableborder=1><tr><td>书号</td><td>书名</td><td>单价
</td><td>数目</td><td>小计</td></tr>"
session("sum")=0
fori=0tonum
session("sum")=session("sum")+session("sum_"&cstr(i))
response.write"<tr><td>"&session("ID_"&cstr(i))&"</td><td>"&
session("BookName_"&cstr(i))&"</td><td>"&session("price_"&cstr
(i))&"</td><td><inputtype=textsize=5name=txtNum"&cstr(i)&"
value="&session("num_"&cstr(i))&"><td>"&session("sum_"&cstr
(i))&"</td></td></tr>"
next
response.write"</table>"
Response.Write"购货总金额:"&session("sum")
endselect
%>
<p><inputtype=submitvalue="修正购物蓝"><inputtype=buttonvalue="返
回"onclick=window.location.href="index.asp?flag=<%=session("flag")%
>"></p>
</form>
</BODY>
</HTML>
其运转界面以下:
鄙人面有总金额的显现,而且购置的数目能够变动。
In.asp
<%@Language=VBScript%>
<%
ifRequest.Form("txtUser")=""orRequest.Form("txtPWD")=""then
Response.Write"用户名或暗码为空,请从头输出,假如您没有注册,请选择注
册!"
else
setrs=server.CreateObject("ADODB.recordset")
rs.Open"select*frominfowhereID="&Request.Form("txtUser")
&"","DSN=sqlsales;UID=sa",3,3
ifrs.RecordCount=0then
Response.Write"此会员号不存在!"
else
iftrim(rs.Fields("PWD"))trim(Request.Form("txtPWD"))then
Response.Write"暗码不准确!"
Response.Writers.Fields("ID")&"<br>"
Response.Writers.Fields("PWD")&"<br>"
Response.WriteRequest.Form("txtPWD")
else
session("UserID")=rs.Fields("ID")
session("UserName")=rs.Fields("Name")
Response.Redirect"index.asp"
Response.Writers.Fields("ID")&"<br>"
Response.Writers.Fields("PWD")&"<br>"
Response.Write"接待到临!"
endif
endif
rs.Close
endif
%>
<HTML>
<HEAD>
<METANAME="GENERATOR"Content="MicrosoftVisualStudio6.0">
</HEAD>
<BODY>
</BODY>
</HTML>
此段程序用于检测登录的正当性。
Registry.asp
<%@Language=VBScript%>
<%
ifRequest.Form("txtID")=""andRequest.Form("txtPWD")=""and
Request.Form("txtPWD1")=""and_
Request.Form("txtname")=""andRequest.Form("txtSFZ")=""and
Request.Form("txtemail")=""and_
Request.Form("txtAdd")=""andRequest.Form("txtPost")=""and
Request.Form("txtPhone")=""then
Response.Write"请仔细填写以下内容:"
else
ifRequest.Form("txtID")=""then
Response.Write"用户名为空,请从头填写!"&"<br>"
elseifRequest.Form("txtPWD")=""then
Response.Write"暗码为空,请从头填写!"&"<br>"
elseifRequest.Form("txtPWD1")=""then
Response.Write"暗码校验为空,请从头填写!"&"<br>"
elseifRequest.Form("txtName")=""then
Response.Write"姓名为空,请从头填写!"&"<br>"
elseifRequest.Form("txtAdd")=""then
Response.Write"接洽地点为空,请从头填写!"&"<br>"
elseifRequest.Form("txtPost")=""then
Response.Write"邮政编码为空,请从头填写!"&"<br>"
elseiftrim(Request.Form("txtPWD"))trim(Request.Form("txtPWD1"))
then
Response.Write"暗码位与校验位纷歧致,请从头输出!"&"<br>"
else
setrs=server.CreateObject("ADODB.Recordset")
rs.Open"select*frominfowhereID="&trim(Request.Form("txtID"))
&"","DSN=sqlsales;UID=sa;",3,3
rs.Open"select*frominfowhereID="&chr(34)&"yuaiwu"&chr
(34),"DSN=sqlsales;UID=sa;",3,3
ifrs.RecordCount0then
Response.Write"此用户已挂号,请选择其余用户名:"
else
dimfld(7)
dimvalue(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.AddNewfld,value
rs.Update
endif
rs.Close
endif
endif
%>
<HTML>
<HEAD>
<METANAME="GENERATOR"Content="MicrosoftVisualStudio6.0">
</HEAD>
<BODYbgColor=oldlace>
<palign=center><fontsize=6color=midnightblue>会员申请</font></p>
<P>
<formaction="registry.asp"method="post">
<TABLEborder=1cellPadding=0cellSpacing=0width="100%">
<TR>
<TDbgColor=bisque>用户名</TD>
<TD><INPUTid=txtIDname=txtID
style="HEIGHT:22px;WIDTH:275px">**</TD></TR>
<TR>
<TDbgColor=bisque>暗码</TD>
<TD><INPUTid=password1name=txtPWD
type=password
style="HEIGHT:22px;WIDTH:274px">**</TD></TR>
<TR>
<TDbgColor=bisque>确认</TD>
<TD><INPUTid=password2name=txtPWD1
type=password
style="HEIGHT:22px;WIDTH:275px">**</TD></TR>
<TR>
<TDbgColor=bisque>姓名</TD>
<TD><INPUTid=text2name=txtname
style="HEIGHT:22px;WIDTH:274px">**</TD></TR>
<TR>
<TDbgColor=bisque>身份证号码</TD>
<TD><INPUTid=text3name=txtSFZ
style="HEIGHT:22px;WIDTH:274px"></TD></TR>
<TR>
<TDbgColor=bisque>Email</TD>
<TD><INPUTid=text4name=txtEmail
style="HEIGHT:22px;WIDTH:273px"></TD></TR>
<TR>
<TDbgColor=bisque>接洽地点:</TD>
<TD><INPUTid=text5name=txtAdd
style="HEIGHT:22px;WIDTH:272px">**</TD></TR>
<TR>
<TDbgColor=bisque>邮政编码:</TD>
<TD><INPUTid=text6
name=txtPost
style="HEIGHT:22px;WIDTH:270px">**</TD></TR>
<TR>
<TDbgColor=bisque>接洽德律风:</TD>
<TD><INPUTid=text5name=txtPhone
style="HEIGHT:22px;WIDTH:270px"></TD></TR>
</TABLE></P>
<Palign=center><INPUTid=submit1name=cmdSubmittype=submitvalue=确
认><INPUTid=reset1name=cmdCanceltype=resetvalue=作废></P></FORM>
<P><FONTcolor=orangered>请注重:</FONT></P>
<UL>
<LI><FONTcolor=orangered>带有**号的栏目是必需填写的,其他的栏目能够不
填</FONT>
<LI><FONTcolor=orangered>以上信息应照实填写,以便我们能与您获得实时的联
系</FONT></LI></UL>
<P></P>
</BODY></HTML>
这个登录界面和年夜多半网上的登录新用户相似。
小结:
几个程序都做了一个扼要地申明,固然,程序做地十分复杂,另有良多功效没有
或有待完善,但它却树模了一个复杂的典范,在此仅供人人参考。假如人人有乐趣,
能够把下面的程序试一下,祝人人乐成!
对用户来说可预见费用、节约费用,可以做到花少钱办大事。由于省去了购买软件和硬件等的前期费用,用户可以租用较高级的应用软件。ASP的收费是根据软件的类型、客制化程度、用户数量、服务期限来定的,对客户来说这笔费用是可以预见的。方便于客户应用软件的升级。 |
|