我在写论坛发帖页面的时候用了session判断,可是window.open('register.php','','width=526,height=206')并未有反应
if($_POST["tj"]=="确定")
{
if($_SESSION["userid"]=="")
{
$js= "<script language='javascript' type='text/javascript'>window.open('register.php','','width=526,height=206')</script>";
echo $js;
exit;
}
请问这是什么问题呢

解决方案 »

  1.   

    window.open 很容易被当成广告拦截。 比较稳当的方法是使用 window.location.href = 'http://xxx.com';
      

  2.   

    不会是给屏蔽了吧?
    先看看JS是否执行。
    echo "<script>alert(1)</script>";
      

  3.   

     在session判断时,你可以换这种判断方式试试:
      if(!$_SESSION['userid'])
       {
        ………………
       }
      

  4.   

    <?
    $js= " <script language='javascript' type='text/javascript'>window.open('register.php','','width=526,height=206') </script>"; 
    echo $js; 
    ?>
    这句在我电脑里面可以执行,应该是$_session的原因