【问题标题】:$_POST open in new edited tab [duplicate]$_POST 在新编辑的选项卡中打开 [重复]
【发布时间】:2016-09-16 09:43:16
【问题描述】:
            <form method="post" target="_blank" action="battle.php" onsubmit="window.open('battle.php','','width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0,left=30,top=0');" >
                <input type="hidden" name="username" value="<?php echo $username; ?>"/>
                <input type="hidden" name="password" value="<?php echo $password; ?>"/>
                <input type="submit" value="OPEN TO BATTLE.php"/>
            </form>

^^工作但不是我想要的方式。

当单击提交按钮时,我试图让这个表单打开一个大小为'width=700,height=500,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0,left=30,top=0'的新窗口。

我想要它以便将 $_POST 数据传输到新网页

【问题讨论】:

  • 问题是:“为什么”?那是90年代
  • “工作但不是我想要的方式。” - 究竟是什么?
  • 我的意思是 $_POST 数据没有被转移到新标签。

标签: javascript php html css


【解决方案1】:

试试这个:

<form method="post" action="battle.php" onsubmit='window.open("battle.php/?width=700&height=500&toolbar=0&menubar=0&location=0&status=0&scrollbars=0&resizable=0&left=30&top=0","_blank");' >

【讨论】:

【解决方案2】:
<form method="post" onsubmit="window.open('http://www.google.com', '_blank', 'toolbar=0,location=0,menubar=0');" >
                <input type="hidden" name="username" value="<?php echo $username; ?>"/>
                <input type="hidden" name="password" value="<?php echo $password; ?>"/>
                <input onclick="" type="submit" value="OPEN TO BATTLE.php"/>
            </form>

【讨论】:

  • 这会使网页全屏打开我希望它以一定的宽度和高度打开。
  • 现在试试我更新的代码
  • 这行得通,但是另一端的 $_POST 数据没有响应 $username = $_POST['username'];回显$用户名;没有反应
猜你喜欢
  • 1970-01-01
  • 2012-05-03
  • 2014-11-03
  • 1970-01-01
  • 2012-10-07
  • 2012-04-25
  • 2014-10-06
  • 2016-03-27
  • 2013-03-11
相关资源
最近更新 更多