Total Pageviews

Saturday 29 December 2012

ASP、PHP页面跳转代码

第一篇: JavaScript跳转

方法一:

1    <script language="javascript">
2        window.location= "http://urdomain.com";
3    </script>


方法二:

1    <script language="javascript">
2        document.location = "http://urdomain.com";
3    </script>


方法三: (带进度条)

01    <html>
02    <head>
03    <meta http-equiv="Content-Language" content="zh-cn">
04    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
05    <title>跳转到baidu.com</title>
06    </head>
07    <body>
08    <form name=loading>
09    <P align=center><FONT face=Arial color=#0066ff size=2>loading...</FONT>
10    <INPUT style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-WEIGHT: bolder; PADDING-BOTTOM: 0px; COLOR: #0066ff; BORDER-TOP-style: none; PADDING-TOP: 0px; BORDER-RIGHT-style: none; BORDER-LEFT-style: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-style: none"
11    size=46 name=chart>
12    <BR>
13    <INPUT style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; COLOR: #0066ff; BORDER-BOTTOM: medium none;" size=47 name=percent>
14    <script language="javascript">
15    var bar=0
16    var line="||"
17    var amount="||"
18    count()
19    function count(){
20        bar=bar+2
21        amount=amount + line
22        document.loading.chart.value=amount
23        document.loading.percent.value=bar+"%"
24        if(bar<99){
25            setTimeout("count()",100);
26        }else{
27            window.location= "http://urdomain.com";
28        }
29    }
30    </script>
31    </P>
32    </form>
33    </body>
34    </html>

第二篇: 页面跳转
1    <head>
2    <meta http-equiv="refresh" content="10; url=http://urdomain.com">
3    </head>

第三篇: 动态页面跳转

方法一: PHP 跳转
1    <?php
2    header("location: http://urdomain.com");
3    ?>

方法二: ASP 跳转
01    <%
02    response.redirect "http://urdomain.com"
03    %>
04   
05    FYI:
06    <%
07    Dim ID1
08    Dim ID2
09    dim str
10    ID1 = Request("forumID")
11    ID2 = Request("threadID")
12    str="/blog/threadview.asp?forumID="& ID1 &"&threadID=" & ID2
13    response.redirect str
14    %>
15    <%
16    response.redirect "http://urdomain.com"
17    %>
18   
19    FYI:
20    <%
21    Dim ID1
22    Dim ID2
23    dim str
24    ID1 = Request("forumID")
25    ID2 = Request("threadID")
26    str="/blog/threadview.asp?forumID="& ID1 &"&threadID=" & ID2
27    response.redirect str
28    %>