我在 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";
}
}
?>