在我的代码中,我可以让一个窗口出现或另一个,但不能同时启动两个窗口。如果两个复选标记都被选中,它将默认为仅第一个。如果第二个只是检查,它将转到第二个 if/popup url 位置。如何使用 2 个不同的 url 启动两个弹出窗口?
<form action="" method="POST" target="popup">
Send a message : <input type="text" name="twitmessage"><br>
<input type="checkbox" name="twitter" value="My Posting Text">Would you like to send to Twitter?<br>
<input type="checkbox" name="facebook" value="Stuff to Post to facebook">Would you like to post to Facebook?<br>
<input type="submit" name="submit_cycle" value="Submit">
</form>
<?php
session_start();
// store session data
$_SESSION['twitmessage'] = $_POST['twitmessage'];
if(isset($_POST['submit_cycle'])) {
if($_POST['twitter']){
echo "<script type=\"text/javascript\"> window.open('../index.php?p=members','popup','width=700,height=400,left=200,top=200,scrollbars=1') ;</script>";
//header("location: ../index.php?p=members");
}
if($_POST['facebook']){
echo "<script type=\"text/javascript\"> window.open('../index.php?p=paybill','popup','width=700,height=400,left=200,top=200,scrollbars=1') ;</script>";
//header("location: ../index.php?p=paybill");
}else{
echo "Something bad happened";
}
}
?>