请教一小段ASP代码,请高手帮个忙

来源:百度知道 编辑:UC知道 时间:2024/05/23 15:58:21
function getPageStr(baseURL, page, pageCount)
if baseURL = "" or isNull(baseURL) then exit function
if inStr(baseURL, "?") and right(baseURL, 1) <> "?" and right(baseURL, 1) <> "&" then
baseURL = baseURL & "&"
else
baseURL = baseURL & "?"
end if

if not isnumeric(page) then page = 1 else page = cint(page)
if not isnumeric(pageCount) then pageCount = 1 else pageCount = cint(pageCount)
if page < 1 then page = 1
if pageCount < 1 then pageCount = 1
if page > pageCount then page = pageCount

dim str
str = ""

if page > 1 then
str = str & "<td width='5%'><a href="&baseURL&"pageno="&(page-1)&">上一页</a></td>"
else
str = str & "<td width='5%'><a href='#'>上一页</a></td>"

你传递参数的时候把classcode=101101加在product.asp?后面就可以了
函数里面就不要判断有没有问号了
你直接传递product.asp?classcode=101101给函数不就可以了

用一个变量获取:fname="http://"&request.ServerVariables("SERVER_NAME")&request.ServerVariables("PATH_INFO")
用fname换掉baseURL。