if strEmail="" then
sError = sError & "请输入Email<br>"
end if
if strPassword="" then
sError = sError & "请输入口令<br>"
end if
If sError="" then
RetrieveLoginData
else
Serror= "请登录" & "<br>" & Serror
end if
setsess "Loginerror",Serror
Setupreturnurl url
Response.redirect url
Sub RetrieveLogindata
Dim fieldvalue
If GetSess("Login")="" then
SetSess "Login","Force"
end if
LocateCustomer strLastName, stremail , strpassword
If strCustomerID <>"" then
LngLoginCount=lngLoginCount+1
UpdateCustomerSessionData
UpdateLoginData
SetSess "Login",strlastname
SetSess "realname",strlastname
Else
SError = SError & getlang("langLoginLocateFail")
SetSess "Login", ""
end if
ShopCloseDatabase dbc
set rs=nothing
end sub
Sub UpdateLoginData
Dim dbc
'on error resume next
OpenCustomerDB dbc
'response.write "Login count" & lngLoginCount
sql = "update customers set "
sql = sql & "logincount=" & lnglogincount
'sql = sql & ",lastlogindate='" & date() & "'"
sql = sql & ",lastlogindate=" & datedelimit(date() )
sql = sql & " where contactid=" & strcustomerid
dbc.execute(sql)
ShopCloseDatabase dbc
end sub
' determine where to go to
Sub SetupReturnurl (url)
if returnurl<>"" then
if Serror="" then
url=returnurl
exit sub
else
url="UserLogin.asp"
end if
exit sub
end if
If Getsess("Followonurl")="" and getsess("Currenturl")="" then
If Serror="" then
url=getconfig("xhome")
else
url="UserLogin.asp"
end if
exit sub
end if
If Serror="" then
url=GetSess("FollowonURL")
else
url=getSess("CurrentURL")
end if
end sub
%>
<%
dim productid
productid=Request("id")
if (productid="") then
response.redirect "index.asp"
Response.end
end if
dim strUrlGo
strUrlGo="/Comment.asp?id="&productid
%>
<%
dim dir,strPage,nPage
dir=Request("dir")
strPage=Request("Page")
if (strPage="") then
nPage=1
else
nPage=CInt(strPage)
end if
dim MyValue,property
MyValue=Request("MyValue")
property=Request("property")
if (property="") then
property="0"
end if
if (MyValue="") then
MyValue="0"
end if
dim result
result=GetListFlower(property,MyValue)
dim aryReturn,i
aryReturn = Split(result,",")
dim startelment,endelment
startelment=(nPage-1)*pagenum
endelment=nPage*pagenum-1
if (endelment> UBound(aryReturn)) then
endelment=UBound(aryReturn)
end if
dim strSplitPage,allpage
allpage=CInt((UBound(aryReturn)-LBound(aryReturn))/pagenum-0.5) +1
strSplitPage=" <b><font color=red>"&nPage&"/"&allpage&"</font> 页</b> "
dim startShow,endShow,nextShow
if ((nPage-5)<=0) then
startShow=1
else
startShow=nPage-5
end if
if ((nPage+5)>allpage) then
endShow=allpage
else
endShow=nPage+5
end if
dim k
For k=startShow To endShow
dim showone
showone="<a href='List.asp?property="&property&"&MyValue="&MyValue&"&Page="&k&"'>"&k&"</a> "
strSplitPage=strSplitPage&showone
Next
if (nPage>1) then
nextShow="<a href='List.asp?property="&property&"&MyValue="&MyValue&"&Page="&(nPage-1)&"'>上一页</a> "
end if
nextShow=nextShow&" "
if (nPage<allpage) then
nextShow=nextShow&"<a href='List.asp?property="&property&"&MyValue="&MyValue&"&Page="&(nPage+1)&"'>下一页</a> "
end if
%>
<!--#include file="inc/navigation.asp"--></td>
<td width="10"> </td>
<td valign="top">
<table border=0 cellspacing="0" cellpadding="0" width=99%>
<tr bgcolor=#ddFFFF><td colspan=3 height=10>
<%=strSplitPage%>
</td><td align="right">
<%=nextShow%>
</td></tr>
<%
dim n
n=0
For i = startelment To endelment
dim one
one=GetProduct(aryReturn(i))
if one(FIELDAUTOID)>0 Then
if ((n mod 4)=0) then
response.write "<tr>"
end if
%>
<td width=20% align="center">
<!--#include file="inc/ListOne.asp"-->
</td>
<%
if ((n mod 4)=3) then
response.write "</tr>"
end if
n=n+1
end if
Next
%>
例程3-8为list.asp显示产品的代码。
例程3-8 list.asp显示产品的代码
<%
dim n
n=0
For i = startelment To endelment
dim one
one=GetProduct(aryReturn(i))
if one(FIELDAUTOID)>0 Then
if ((n mod 4)=0) then
response.write "<tr>"
end if
%>
<td width=20% align="center">
<!--#include file="inc/ListOne.asp"-->
</td>
<%
if ((n mod 4)=3) then
response.write "</tr>"
end if
n=n+1
end if
Next
%>