你在1.php的link 里的代码 <a href="http://www.sina.com.cn" target="你frame的name">新浪首页</a>就可以了~~你点这个link就只会在你1.php的frame里显示了~~~

解决方案 »

  1.   

    这个是可以 ,我需要自动跳转呀 
    <a href="">
    <form action="">这个都能在框架里跳转,但 header(location)不行呀
      

  2.   

    <?= '<script>self.location.href="' . $location . '"</script>' ?>
      

  3.   

    楼主在PHP版也有这一贴
    http://community.csdn.net/Expert/TopicView3.asp?id=5014385
    另附:我本地测试是可以的,楼主可以按下面方试试:
    /*************8随便取下名,test.php***************/<?php
    function welcom_to_php()
    {
    echo "Hello World!";
    }
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <meta http-equiv="content-type" content="text/html" charset="GB2312">
    <link rel="stylesheet" type="text/css" href="">
    <script type="text/javascript" src=""></script>
    <script language="javascript" type="text/javascript"></script>
    </HEAD><BODY>
    <body>a
    <iframe name="frame1" src="p1.php" border="1" bordercolor="#3399FF">
    </BODY>
    </HTML>/**********下面取名为p1.php**************8/<?php
    header("Location:http://www.163.com");
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <meta http-equiv="content-type" content="text/html" charset="GB2312">
    </HEAD><BODY></BODY>
    </HTML>
      

  4.   

    1.php
    里面的跳转这样写
    <?
    echo "<script>location='http://www.sina.com.cn;</script>";
    ?>