2
我是PHP和HTML表單的新手。我試圖發送下面的表單數據到我的PHP腳本sendms.php它似乎並沒有從PHP表單獲取輸入數據。發送HTML輸入到PHP Twilio腳本
<form action="sendsms.php" method="post" >
<div id="space">Cell:<div><input type="number" name="phone" id="number" ></div></div>
<div id="space"><div>Message</div><div><input type="text" name="message" id="message"> </div></div>
<div id="button"><input type="submit" name="send" value="Send" id="button" ></div>
</form>
這是我的PHP文件sendsms.php
<?php
// this line loads the library
require('twilio-php/Services/Twilio.php');
$account_sid = 'REMOEVD';
$auth_token = 'REMOVED';
$client = new Services_Twilio($account_sid, $auth_token);
$client->account->messages->create(array(
'To' => $_POST['phone'];,
'From' => "+16194523868",
'Body' => $_POST['message'];,
));
使用了'方法=「郵報」'但試圖讀取'$ _GET',你需要使用'$ _REQUEST'或'$ _POST' – 2014-10-17 23:39:54