标题:asp网站程序首页可以运行,其他链接点击了。链接会变,页面却还停留在首页的 ...
取消只看楼主
Mr_Feng
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-8-3
结帖率:0
已结贴  问题点数:20 回复次数:0 
asp网站程序首页可以运行,其他链接点击了。链接会变,页面却还停留在首页的页面?请问这是怎么了?
<%if false then%><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><%end if%>
<%root="http://"&Request.ServerVariables("server_name")&"/"
function replace_fuhao(str0)
str=replace(str0," ","-")
str=replace(str,"/","-")
str=replace(str,"'","-")
str=replace(str,"::","/")
str=replace(str,"?","-")
str=replace(str,"""","-")
str=replace(str,"#","-")
str=htmlweb&str&"/"
replace_fuhao=str
end function

function formatname(str0,id)
str=replace_fuhao(str0&"-"&id)
formatname=str
end function

function companyname(id,str1323)
    companyname=replace_fuhao(id&"-c-"&str1323)
end function

function newsname(str000)
    newsname=replace_fuhao(str000)
end function

function getvalue(valible)
str=web0'Ĭ
denghao="="
fenhao=vbCrLf
str_temp0=fenhao&str&fenhao
valible_temp0=fenhao&valible&denghao
valuenum=instr(str_temp0,valible_temp0)
    if valuenum=0 then
        getvalue=""
    else   
        getvalue1=mid(str_temp0,valuenum+len(valible_temp0))        
        valuenum2=instr(getvalue1,fenhao)        
        getvalue=left(getvalue1,valuenum2-1)                                
    end if
end function%>

<%currurl00=Request.ServerVariables("QUERY_STRING")
if right(Request.ServerVariables("server_name"),3)="biz" then
    currurl00=split(replace(currurl00,"html","")&".biz:80/",".biz:80/")(1)
elseif right(Request.ServerVariables("server_name"),3)="com" then
    currurl00=split(replace(currurl00,"html","")&".com:80/",".com:80/")(1)
elseif right(Request.ServerVariables("server_name"),3)="net" then
    currurl00=split(replace(currurl00,"html","")&".net:80/",".net:80/")(1)
elseif right(Request.ServerVariables("server_name"),2)="us" then
    currurl00=split(replace(currurl00,"html","")&".us:80/",".us:80/")(1)
    elseif right(Request.ServerVariables("server_name"),2)="us" then
    currurl00=split(replace(currurl00,"html","")&".cc:80/",".cc:80/")(1)
elseif right(Request.ServerVariables("server_name"),2)="cn" then
    currurl00=split(replace(currurl00,"html","")&".cn:80/",".cn:80/")(1)
end if

CurrURLarr=split("-"&currurl00&"-","-")
CurrURL=split(CurrURLarr(ubound(CurrURLarr)-1)&".",".")(0)
CurrURLarr=split(currurl00&"/","/")
if CurrURLarr(0)="search" then
    request_searchtext=replace(unescape(CurrURLarr(1)),"-"," ")
    request_page=CurrURLarr(2)
elseif CurrURLarr(0)="New-Arrivals" or  CurrURLarr(0)="All-Products" or  CurrURLarr(0)="Bestselling" or  CurrURLarr(0)="Super" then
    request_searchtext2=replace(unescape(CurrURLarr(0)),"-"," ")
    request_page=CurrURLarr(1)
elseif CurrURLarr(0)="allNews" or CurrURLarr(0)="Blogs" then
    temp_newsjj=CurrURLarr(0)
    request_page=CurrURLarr(1)
elseif ubound(CurrURLarr)=2 then
    if split(CurrURLarr(0),"-")(1)="c" then
        temp_companyid=split(CurrURLarr(0),"-")(0)
    else
        if instr(replace(CurrURL,"/",""),"p")<>0 then
            temp_newsid=split(replace(CurrURL,"/",""),"p")(1)
            temp_newsjj="allNews"
        elseif instr(replace(CurrURL,"/",""),"b")<>0 then
            temp_newsid=split(replace(CurrURL,"/",""),"b")(1)
            temp_newsjj="Blogs"
        elseif  isnumeric(replace(CurrURL,"/","")) then
            request_hw_id=replace(CurrURL,"/","")
        else
            if split(CurrURL,"/")(1)<>"" then
                request_id=split(CurrURL,"/")(0)
            else
                request_id=replace(CurrURL,"/","")
            end if
        end if
    end if
    request_page=CurrURLarr(1)
end if

if temp_companyid="" then temp_companyid="---"
if request_id="" then request_id="---"
if request_hw_id="" then request_hw_id="---"
if temp_newsid="" then temp_newsid="---"%>

<%sub searchbox()%>

<form name="search1" method="post" action="<%=root%>products.asp" style="margin:0" onsubmit="if(searchtext.value==''&&searchtext2.value==''){alert('Please input the key word!');return false;}">
      <img src="<%=root%>images/products.gif" align="absmiddle"/>
      <select name="searchcate">
      <option value="">All Categories</option>
   
      </select>
      <input name="searchtext" type="text" id="searchtext" size="16" maxlength="50" /> <input type="submit" value="Search" name="sbt" />
      ID: <input name="searchtext2" type="text" id="searchtext2" size="16" maxlength="50" /> <input type="submit" value="Search" name="sbt" />
      &nbsp;
    </form>
<%end sub%>
<%function getparentname(sqlaaa1)

            set aaa1=server.CreateObject("adodb.recordset")
                aaa1.open sqlaaa1,conn,1,1
                if not aaa1.eof then
                 temaaa1=""               
                 do while not aaa1.eof                     
                    if temaaa1<>"" then temaaa1=temaaa1&"|"
                    temaaa1=temaaa1&aaa1(0)
                    aaa1.movenext
                loop
                else
                 temaaa1= "---"
                end if
                aaa1.close
                set aaa1=nothing
                getparentname=temaaa1
    end function%>
<%

function getprice(price_num,pricestr0)
    pricestr=trim(replace(pricestr0,"",","))
    if pricestr="" then   
    getprice02="0"
    elseif instr(pricestr,"=")=0 then
    getprice02=pricestr
    else
        pricearr=split(pricestr,",")        
        
        for price_i=ubound(pricearr) to 0 step -1
            price2=split(pricearr(price_i),"=")
            if int(price_num)>=int(price2(0)) then
                 getprice02=price2(1)
                 exit for
             elseif price_i=0 then
                 getprice02=price2(1)
                exit for
             end if
        next
    end if
    if not isnumeric(getprice02) then
    getprice="0"
    else
    getprice=getprice02
    end if
   
end function

function getpriceminnum(pricenum_num,pricenumstr0)
    pricenumstr=trim(replace(pricenumstr0,"",","))
    if pricenumstr="" then   
    getpricenum02="1"
    elseif instr(pricenumstr,"=")=0 then
    getpricenum02="1"
    else        
        getpricenum02=    split(pricenumstr,"=")(0)
        if not isnumeric(getpricenum02) then getpricenum02="1"   
    end if
   
    getpriceminnum=getpricenum02   
   
end function

realclassid="0"
function showGuaid2009(typeid,realid,typeid0,showlink)
 fuhao09=" &raquo; "
     Set rsGuaid= Server.CreateObject("ADODB.RecordSet")
     if typeid="n" then
         sql="Select * from nsort where nsort_id="&realid
        rsGuaid.open sql,conn,1,1
        if not rsGuaid.eof or not rsGuaid.bof then
            temparr=showGuaid2009("s",cstr(rsGuaid("sort_id")),typeid0,showlink)
            
            
            
            if not showlink and typeid=typeid0  then
            temparr(0)=temparr(0)&fuhao09&"<script>nfirst='"&realid&"';</script><b>"&rsGuaid("nsort_name")&"</b>"
            else
            temparr(0)=temparr(0)&fuhao09&"<script>nfirst='"&realid&"';</script><a href="""&root&formatname(rsGuaid("nsort_name"),"n"&realid)&""">"&rsGuaid("nsort_name")&"</a>"            
            end if
            if  typeid=typeid0 then            
            temparr(0)=temparr(0)
            end if
            
            temparr(1)=rsguaid("nsort_name")&", "&temparr(1)
            temparr(2)=rsguaid("nsort_name")&", "&temparr(2)
            temparr(3)=rsguaid("nsort_name")&", "&temparr(3)
            if ""&rsguaid("title1")<>"" then temparr(1)=""&rsguaid("title1")
            if ""&rsguaid("keyword1")<>"" then temparr(2)=""&rsguaid("keyword1")
            if ""&rsguaid("discription1")<>"" then temparr(3)=""&rsguaid("discription1")
            
            temparr(4)=""&rsguaid("nsort_name")
            temparr(5)="<a href="""&root&formatname(rsGuaid("nsort_name"),"n"&realid)&""">"
            showGuaid2009=temparr
        end if
        rsGuaid.close
        set rsGuaid=nothing
     elseif typeid="s" then
         sql="Select * from sort where sort_id="&realid
        rsGuaid.open sql,conn,1,1
        if not rsGuaid.eof or not rsGuaid.bof then
            temparr=showGuaid2009("c",cstr(rsGuaid("class_id")),typeid0,showlink)
            
            
            if not showlink and typeid=typeid0  then
            temparr(0)=temparr(0)&fuhao09&"<script>sfirst='"&realid&"';</script><b>"&rsGuaid("sort_name")&"</b>"
            else            
            temparr(0)=temparr(0)&fuhao09&"<script>sfirst='"&realid&"';</script><a href="""&root&formatname(rsGuaid("sort_name"),"s"&realid)&""">"&rsGuaid("sort_name")&"</a>"
            end if
            if  typeid=typeid0 then            
            temparr(0)=temparr(0)
            end if
            
            temparr(1)=rsguaid("sort_name")&", "&temparr(1)
            temparr(2)=rsguaid("sort_name")&", "&temparr(2)
            temparr(3)=rsguaid("sort_name")&", "&temparr(3)
            if ""&rsguaid("title1")<>"" then temparr(1)=""&rsguaid("title1")
            if ""&rsguaid("keyword1")<>"" then temparr(2)=""&rsguaid("keyword1")
            if ""&rsguaid("discription1")<>"" then temparr(3)=""&rsguaid("discription1")
            
            temparr(4)=""&rsguaid("sort_name")
            temparr(5)="<a href="""&root&formatname(rsGuaid("sort_name"),"s"&realid)&""">"
            showGuaid2009=temparr
        end if
        rsGuaid.close
        set rsGuaid=nothing
    elseif    typeid="c" then   
    realclassid=""&realid
        sql="Select * from class where class_id="&realid
        rsGuaid.open sql,conn,1,1
        if not rsGuaid.eof or not rsGuaid.bof then
            dim temparr(10)'һԪص
            
            
            
            if not showlink and typeid=typeid0  then
            temparr(0)="<script>bfirst='"&realid&"';</script><a href='"&root&"'>Home</a> &raquo; <b>"&rsGuaid("class_name")&"</b>"
            else
            temparr(0)="<script>bfirst='"&realid&"';</script><a href='"&root&"'>Home</a> &raquo; <a href="""&root&formatname(rsGuaid("class_name"),"c"&realid)&""">"&rsGuaid("class_name")&"</a>"
            end if
            if  typeid=typeid0 then
            temparr(0)=temparr(0)
            end if
            
            temparr(1)=rsguaid("class_name")&", Wholesale "&rsguaid("class_name")&", China "&rsguaid("class_name")&",Discount "&rsguaid("class_name")&", Cheap "&rsguaid("class_name")&",  Authentic "&rsguaid("class_name")&", Replica "&rsguaid("class_name")&", Youth "&rsguaid("class_name")&", Official "&rsguaid("class_name")&", Pro Bowl "&rsguaid("class_name")&", Super Bowl "&rsguaid("class_name")&""            
            temparr(2)=temparr(1)
            temparr(3)=temparr(1)
            if ""&rsguaid("title1")<>"" then temparr(1)=""&rsguaid("title1")
            if ""&rsguaid("keyword1")<>"" then temparr(2)=""&rsguaid("keyword1")
            if ""&rsguaid("discription1")<>"" then temparr(3)=""&rsguaid("discription1")
            
            
            temparr(4)=""&rsguaid("class_name")'ǰ
            temparr(5)="<a href="""&root&formatname(rsGuaid("class_name"),"c"&realid)&""">"'ǰ
            showGuaid2009=temparr
            end if
        rsGuaid.close
        set rsGuaid=nothing
    end if
end function
%>
<%function lleft(content,lef)
for le=1 to len(content)
if asc(mid(content,le,1))<=1 then
lef=lef-2
else
lef=lef-1
end if
if lef<=0 then
str123=".."
exit for
end if
next
lleft=left(content,le)&str123
end function
%>


<%sub showhw1()%>
<div id=hw00><%call showhw10()%>            
        </div>
<%end sub%>
<%sub showhw10()%>
<div id=hw1>
        <a href="<%=root%><%=formatname(rshw(1),rshw(0))%>">
        <%if rshw(2)<>"" then
        pic1=split(rshw(2),"|")(0)%>
        <img src="<%=root%><%=pic1%>"/>
        <%else%>
        nopic
        <%end if%></a></div>
        <div id=hw2><b>ID:&nbsp;<%=rshw(0)%></b><br />
        <a href="<%=root%><%=formatname(rshw(1),rshw(0))%>"><%=rshw(1)%></a>
        <br /><b style="color:#f00;">Free Shipping</b><br /><span>Price:&nbsp;<%=tran(rshw(3))%></span><br>
        <a href="<%=root%><%=formatname(rshw(1),rshw(0))%>"><img src="<%=root%>images/buy_now_button.gif" border="0" /></a>
        </div>
<%end sub%>



<%function fromtohw2(from0,to0,currectid)

sql0002=" select top "&(to0-from0)&" hw_id,hw_name,hw_pic,hw_cash from hw where "&temp5&" hw_id>"&currectid&" order by hw_id"
sql000=" select top "&(to0-from0)&" hw_id,hw_name,hw_pic,hw_cash from hw where "&temp5&" hw_id<"&currectid&" order by hw_id desc"

set rshw=server.CreateObject("adodb.recordset")
    rshw.open sql0002,conn,1,1
    fromnum=-rshw.recordcount
    tonum=getparentname("select count(*) from("&sql000&")")

   
   
    if (tonum-fromnum)<=(to0-from0) then
   
    fromnumreal=fromnum
    tonumreal=tonum
   
   
    elseif tonum>=to0 and fromnum<=from0 then
   
    fromnumreal=from0
    tonumreal=to0
   
   
    elseif tonum<to0 then

    fromnumreal=from0+(tonum-to0)
    tonumreal=tonum
    else
   
    fromnumreal=fromnum
    tonumreal=to0+(fromnum-from0)
    end if
   
   
 
            
        fi=-1
        
        
        if not rshw.eof then tempresult="<a  href=' "&root&formatname(rshw(1),rshw(0))&" '><img alt=Previous align=absmiddle src="&root&"images/button_Prev.gif border=0></a>"'=======================
        do while not rshw.eof and fi>=fromnumreal
            
            
            call showhw1()   
            
        rshw.movenext
        fi=fi-1
        loop
rshw.close
set rshw=server.CreateObject("adodb.recordset")
    rshw.open sql000,conn,1,1        
        fi=1
        if not rshw.eof then tempresult=tempresult&" <a  href=' "&root&formatname(rshw(1),rshw(0))&" '><img alt=Next align=absmiddle src="&root&"images/button_Next.gif border=0></a>"'=======================
        do while not rshw.eof and fi<=tonumreal'tonum

            
            call showhw1()

        rshw.movenext        
        fi=fi+1
        loop
rshw.close
set rshw=nothing
fromtohw2=tempresult
end function
%>

<%sub pricetotable(str0034)%>
<div class="viewstabletitle">Qty Discounts New Price</div>
<table width="100%" border="0" cellpadding="1" cellspacing="1" class="viewstable">

<%str0035=str0034
if str0035="" then str0035="0"
if instr(str0035,"=")=0 then
str0035="1="&str0035
end if
str0035=replace(str0035,"",",")
str0035arr=split(str0035,",")
str0036=""
for sti=0 to ubound(str0035arr)
    temparr_00001=split(str0035arr(sti)&"=","=")
    btofnumber=temparr_00001(0)
    priceofnumber=temparr_00001(1)
   
    sti2=sti+1
    if sti2<=ubound(str0035arr) then
    temparr_00002=split(str0035arr(sti2)&"=","=")
        if isnumeric(temparr_00002(0)) then
            upofnumber=""&(int(temparr_00002(0))-1)
        else
            upofnumber="#err"
        end if
    else   
    upofnumber="100"
    end if
   
    str0036=str0036& "<tr><td>"&btofnumber&" - "&upofnumber&"</td><td>"&tran(priceofnumber)&"</tr>"
next

response.Write str0036
%>
</table>
<%end sub

            
            
function tran(money)        
        tran=tran3(session("moneytype"))&(int(eval(session("moneytype"))*money*100)/100)
end function
function tran3(moneytype3)
        if moneytype3="USD" then
            tran3="$"&" "
        elseif moneytype3="$"&" " then
            tran3="USD"            
        elseif moneytype3="RMB" then
            tran3="¥"
        elseif moneytype3="¥" then
            tran3="RMB"
        elseif moneytype3="EURO" then
            tran3="&euro; "
        elseif moneytype3="&euro;" then
            tran3="EURO"
        elseif moneytype3="GBP" then
            tran3="&pound; "
        elseif moneytype3="&pound; " then
            tran3="GBP"
        elseif moneytype3="AUD" then
            tran3="AU$ "
        elseif moneytype3="AU$ " then
            tran3="AUD"
        elseif moneytype3="CAD" then
            tran3="CA$ "
        elseif moneytype3="CA$ " then
            tran3="CAD"
        end if
end function
function tran2(money)
        if not isnumeric(money) then tran2=0        
        tran2=int(eval(session("moneytype"))*money*100)/100
end function%>


<%'======showpage===============
sub showpage(sqlpage)
if instr(sqlpage,"?") then
strpage="&page"
else
strpage="?page"
end if%>


<DIV style="float:left">Total<%=PAGETOTAL%>Pages,<%=""&totalcount&"Messages"%></DIV>
     <a  href="<%=sqlpage&strpage&"=1"%>">First</a>&nbsp;|&nbsp;<a  href="<%=sqlpage&strpage&"="&(page-1)%>">Prev</a>&nbsp;|&nbsp;<a href="<%=sqlpage&strpage&"="&(page+1)%>">&nbsp;Next</a></a>&nbsp;|&nbsp;<a  href="<%=sqlpage&strpage&"="&pagetotal%>">&nbsp;Last</a></a>
    &nbsp; Trun to
<input name="page" value="<%=page%>" size="1"  onchange="location='<%=sqlpage&strpage&"="%>'+this.value" style="height:10px;font-size:10px; line-height:10px;"/>


<%end sub
sub showpage2()%>
    <script>function jump(numi){
            var urls=window.location.href;
            var num1=urls.lastIndexOf("_p");
            if(num1!= -1)location=urls.substring(0,num1+2)+numi+".html";}
            </script>
               
            <a style="float:left">页次<font color="#FF0000"><%=page%></font>/<%=PAGETOTAL%>,共<%=totalcount%>条信息</a>
 
            <%                                                                                                                           
            pageno=page
            if isempty(pageno) or cint(pageno)<1 or cint(pageno)>pagetotal then
                pageno=1
            end if
            %>            
            <%if cint(pageno)>1 then%>
            <a href="javascript:jump(<%=pageno-1%>)">&nbsp;&laquo;&nbsp;</a>
            <%else%>
            &nbsp;&laquo;&nbsp;
            <%end if%>
            <%                     
            pp=cint(pageno)-3            
              if pp<1 then            
              pp=1            
              end if            
            for pno=pp to pagetotal            
            p=p+1            
            if pno=cint(pageno) then%><b style="color:#f50"><%=pno%></b>
            <%else%>
            <a href="javascript:jump(<%=pno%>)"><%=pno%></a>
            <%end if%>                     
            <%                     
            if p>=7 then exit for            
            next%>
            <%if cint(pageno)< pagetotal then%> <a href="javascript:jump(<%=pageno+1%>)">&nbsp;&raquo;&nbsp;</a><%else%>
            &nbsp;&raquo;&nbsp;
            <%end if%>
<%end sub
sub showpage_(sqlpage)
if instr(sqlpage,"?") then
strpage="&page"
else
strpage="?page"
end if%>


    <DIV style="float:left">All <%=PAGETOTAL%> pages &nbsp;<%=""&totalcount&" items"%></DIV> &nbsp; &nbsp; <a  href="<%=sqlpage&strpage&"=1"%>"><img src="<%=root%>inc/First.gif" border="0"/></a>&nbsp;<a  href="<%=sqlpage&strpage&"="&(page-1)%>"><img src="<%=root%>inc/prev.gif" border="0"/></a>&nbsp;<a href="<%=sqlpage&strpage&"="&(page+1)%>">&nbsp;<img src="<%=root%>inc/next.gif" border="0"/></a></a>&nbsp;<a  href="<%=sqlpage&strpage&"="&pagetotal%>">&nbsp;<img src="<%=root%>inc/last.gif" border="0"/></a></a>
    &nbsp; GO
<input name="page" value="<%=page%>" size="1"  align="absmiddle" onchange="location='<%=sqlpage&strpage&"="%>'+this.value"/>


<%end sub
sub showpage2_()%>
    <script>function jump(numi){numi2=numi;
            if(numi2==1)numi2="1";
            var urls=window.location.href;
            urls=urls.substring(urls.indexOf("<%=lifeorcom%>")+5,urls.length);            
            var num1=urls.lastIndexOf("/");            
            if(num1!= -1)location=numi2;
            else location=numi2;            
            }
            </script>
               
            No.<font color=red><%=page%></font>/<%=PAGETOTAL%>Page,Total <font color=red><%=totalcount%></font> item(s)  &nbsp;
 
            <%                                                                                                                           
            pageno=page
            if isempty(pageno) or cint(pageno)<1 or cint(pageno)>pagetotal then
                pageno=1
            end if
            %>            
            <%if cint(pageno)>1 then%>
            <a  style="border:0;background:url();" href="javascript:jump(<%=pageno-1%>)">&nbsp;&laquo;&nbsp;</a>
            <%else%>
            <font color=gray>&nbsp;&laquo;&nbsp;</font>
            <%end if%>
            <%fromleftnum=5
            if pagetotal-pageno<5 then  fromleftnum=9-pagetotal+pageno   
            pp=cint(pageno)-fromleftnum            
              if pp<1 then            
              pp=1            
              end if            
            for pno=pp to pagetotal            
            p=p+1            
            if pno=cint(pageno) then%><a style="background:#ccc;"><%=pno%></a>
            <%else%>
            <a href="javascript:jump(<%=pno%>)"><%=pno%></a>
            <%end if%>                     
            <%                     
            if p>=10 then exit for            
            next%>
            <%if cint(pageno)< pagetotal then%> <a style="border:0;background:url();" href="javascript:jump(<%=pageno+1%>)">&nbsp;&raquo;&nbsp;</a><%else%>
            <font color=gray>&nbsp;&raquo;&nbsp;</font>
            <%end if%>&nbsp; <select name="page" style="font-size:10px;" onchange="jump(this.value)">
        <script>for (i=1;i<=<%=PAGETOTAL%>;i++)
        {document.write("<option");
        if(<%=pageno%>==i)document.write(" selected")
        document.write(" value="+i+">PAGE "+i+"</option>");}
        </script>
        </select>
<%end sub%>
搜索更多相关主题的帖子: function content 网站程序 replace false 
2013-08-03 20:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-418559-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026852 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved