0

JavaScript でそれを行う方法はたくさんありますが、php スクリプトの途中で smack を呼び出す必要があります。

<form action="" method="POST" target='popup' onsubmit="window.open('','popup','width=700,height=400,left=200,top=200,scrollbars=1')">
        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']){
                header("location: ../index.php?p=members");
        }
        if($_POST['facebook']){
                header("location: ../index.php?p=paybill");
        }else{
                echo "Something bad happened";
        }
}
?>
4

2 に答える 2

0

できません。

ウィンドウを開くことは、PHP を使用して実行できないクライアント側の操作です。それが原則です。

クライアント側で新しいウィンドウを開く JS を生成できます。

<script>
    window.open('<?php echo htmlentities($url); ?>')
</script>
于 2013-11-13T20:02:58.987 に答える