文件名:sms1.php 位于:http ://techmentry.com/sms1.php
sms1.php的PHP代码:
<?php
//Variables to POST
$user = "hidden";
$password = "hidden";
$mobiles = "$_POST[phone]";
$message = "$_POST[msg]";
$sender = "$_POST[sender]";
//Initialize CURL data to send via POST to the API
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.hidden/sendhttp.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"user=$user&
password=$password&
mobiles=$mobiles&
message=$message&
sender=$sender"
);
//Execute CURL command and return into variable $result
$result = curl_exec($ch);
//Do stuff
echo "$result";
?>
<br><br><br>
<form name='sms' action='' method='post'>
Phone number<br/><input type='text' name='phone' value='' maxlength=12/>
<br/>
Sender ID (from) <br/><input type='text' name='sender' value='' maxlength=15/>
<br/>
Message : <br/><textarea rows=5 cols=30 name='msg'></textarea>
<br/>
<input type='submit' value='Send'>
</form>
请参阅http://techmentry.com/sms1.php上的输出。它已经显示错误代码(105)(已经 - 因为它应该在用户单击发送按钮时显示错误代码)。105 错误代码表示缺少“密码”参数。但是我已经在代码中说明了密码。
请帮忙 :)