IsaacZ 发表于 2009-4-6 21:29:41

ASP页面转向代码

ASP 脚本:<%
dim url
Private Function GetUrl()
Dim s criptAddress, M_ItemUrl, M_item
s criptAddress = CStr(Request.ServerVariables("s cript_NAME")) '取得当前地址
M_ItemUrl = ""
If (Request.QueryString <> "") Then
s criptAddress = s criptAddress & "?"
For Each M_item In Request.QueryString
If InStr(page,M_Item)=0 Then
M_ItemUrl = M_ItemUrl & M_Item &"="& Server.URLEncode(Request.QueryString(""&M_Item&"")) &

"&"
End If
Next
end if
GetUrl = s criptAddress & M_ItemUrl
End Function
%>
<%Response.Redirect "http://www.abc.com/"&Url&""%> '跳转的域名
JS脚本:<script language="javascript">
var newdomain="www.163.com";          //新域名,例如说跳到 www.163.com
var stoptime=0;                  //页面停留时间,以秒为单位
var My_Url=document.location.href;
godomain();
function godomain()
{
    var str=My_Url;
    stag=str.indexOf('//')+1;
    str=str.substring(stag+1,str.length)
    stag=str.indexOf('/');
    rstr=str.substring(0,stag);
    olddomain=rstr;
    My_Url=My_Url.replace(olddomain,newdomain);
    setTimeout("gourl()",stoptime*1000);
}
function gourl()
{window.location=My_Url;}
</script>来源:http://www.phpwind.net/read-htm-tid-490700.html ,未验证。
页: [1]
查看完整版本: ASP页面转向代码