drsrq26482
2014-07-09 11:18
浏览 48

如何将带有参数的php页面重定向到新的选项卡或窗口

I have print option in my application. When user click on print button the print page should be open in another tab/window.

Again I am sending some parameters with print page as it contain dynamic values.

to do so i have used php header as

header("location:Delivery_form.php?cnno=$cnno&copies='$nocopy'");

but it is redirecting in parent page. and javascript window.open as

echo "<script type=\"text/javascript\">".
        "window.open('Delivery_form.php?cnno='".$cnno."&copies=".$nocopy ")".
             "</script>";

please help me to achieve this funcnality.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • douhengdao4499 2014-07-09 11:59
    已采纳

    The php header should be :

    header("location:Delivery_form.php?cnno=".$cnno."&copies=".$nocopy);
    

    Script

    echo "<script type=\"text/javascript\">
            window.open('Delivery_form.php?cnno=".$cnno."&copies=".$nocopy."', '_blank')
        </script>";
    
    点赞 打赏 评论
  • duanlv5084 2014-07-09 11:36

    Try this

    echo "<script type=\"text/javascript\">
            window.open('Delivery_form.php?cnno=".$cnno."&copies=".$nocopy."', '_blank')
        </script>";
    
    点赞 打赏 评论

相关推荐 更多相似问题