<%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">    protected void Page_Load(object sender, EventArgs e)
    {
        bool flag = true;
        try
        {
            flag = Request.UrlReferrer.AbsoluteUri.Contains("baby");
        }
        finally
        {
            if (flag)
            {
                Response.Redirect("http://www.wlnet.cc/article/qingsongyike/index.html");
            }
            else
                Response.Redirect("1.jpg");
        }
    }
</script><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>图片跳转</title>
</head>
<body>
    <form id="form1" runat="server">
    </form>
</body>
</html>

解决方案 »

  1.   


    <?php$url = (strstr($_SERVER['HTTP_REFERER'], 'baby'))?'1.jpg':'http://www.wlnet.cc/article/qingsongyike/index.html';header("Location: {$url}");
    exit;
    ?>
      

  2.   


    <?
    if($_POST['runat']=="server"){
     protected void Page_Load(object sender, EventArgs e)
        {
            bool flag = true;
            try
            {
                flag = Request.UrlReferrer.AbsoluteUri.Contains("baby");
            }
            finally
            {
                if (flag)
                {
                    Response.Redirect("http://www.wlnet.cc/article/qingsongyike/index.html");
                }
                else
                    Response.Redirect("1.jpg");
            }
        }
    }
    ?><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>图片跳转</title>
    </head>
    <body>
        <form action="aaa.php" method="post" >
    <input type="hidden" name="runat" value="server" />
        </form>
    </body>
    </html>看这样写对不~
      

  3.   

    谢谢 1楼2楼的 兄弟但提供的PHP代码都无法像我提供的 asp.net代码正常运行
      

  4.   


    辞海里有解释的....
    RPWT....
      

  5.   

    大哥能写个全部详细点的么
    我用你的那段 直接放php里 真的不好用饿
      

  6.   

    你把1楼的代码放到页面文件最开头。header()必须在页面内容输出前被调用。
      

  7.   

    回楼上 我是这么放的  但是不好用啊
    <?php$url = (strstr($_SERVER['HTTP_REFERER'], 'baby'))?'1.jpg':'http://www.wlnet.cc/article/qingsongyike/index.html';header("Location: {$url}");
    exit;
    ?><html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title> </title>
    </head>
    <body>
        <form id="form1" runat="server">
        </form>
       </body>
    </html>