嗨,我正在尝试使用 php 中的批量短信 api 发送批量短信我是新手,所以我不太了解这个 bt 我通过谷歌找到了一些脚本,但是当我尝试发送短信时,它显示错误“不DATA RECIEVED" 谁能帮我这里是 m 脚本
<?php
if (isset($_POST["submit"])) {
require("includes/config.php");
require("includes/dbconnect.php");
require("includes/functions.php");
$tourdb = DBSUFFIX . $_SESSION["cono"] . "_" . $_SESSION["tourname"];
mysql_select_db($tourdb);
$message = substr($_POST["sms"], 0, 160);
$cond = "";
if (!empty($_POST["district"])) {
$district = trim($_POST["district"]);
$cond .= "AND `district` = '$district'";
}
if (!empty($_POST["state"])) {
$state = trim($_POST["state"]);
$cond .= "AND `state` = '$state'";
}
if (!empty($_POST["for"])) {
$for = trim($_POST["for"]);
$cond .= "AND `visitingfor` = '$for'";
}
$ccond = "";
if (!empty($_POST["Airline"])) {
$air = trim($_POST["Airline"]);
$ccond .= "AND `airline_code` = '$air'";
}
if (!empty($_POST["bjdate"])) {
$date1 = trim($_POST["bjdate"]);
$ccond .= "AND `dept_date` = '$date1'";
}
if (!empty($_POST["jbdate"])) {
$date2 = trim($_POST["jbdate"]);
$ccond .= "AND `dept_date` = '$date2'";
}
if (!empty($_POST["siscono"])) {
$siscono = trim($_POST["siscono"]);
$cond .= "AND `company` = '$siscono'";
}
if (!empty($_POST["batch"])) {
$batch = $_POST["batch"];
$ccond .= " AND `batchno` = '$batch' ";
}
$hajicond = "";
if (!empty($_POST["fromhaji"]) && !empty($_POST["tohaji"])) {
$fromhaji = $_POST["fromhaji"];
$tohaji = $_POST["tohaji"];
$hajicond = " AND `hajino` BETWEEN '$fromhaji' AND '$tohaji'";
}
$paxcond = "";
if (!empty($_POST["frompax"]) && !empty($_POST["topax"])) {
$frompax = $_POST["frompax"];
$topax = $_POST["topax"];
$paxcond = " AND `paxid` BETWEEN '$frompax' AND '$topax'";
}
$msg = $_POST["sms"];
$ctr = 0;
$query = mysql_query("SELECT RIGHT(`mobile`,10) as `mobile` FROM `pax` WHERE LENGTH(`mobile`) >= 10 AND `paxid` IN (SELECT `paxno` FROM `airline_detail` WHERE paxno IS NOT NULL $ccond) $cond $hajicond $paxcond ") or die(mysql_error());
while ($pax = mysql_fetch_array($query)){
$ctr++;
$to.= "$pax[mobile],";
}
$to.= "8652372200";
$user = "****";
$password = "t*****";
$mobilenumbers = "$to";
$message = "$msg";
$senderid = "****";
$url = "http://tran.mobilogi.com/api/httpapi.php";
$message = urlencode($message);
$ch = curl_init();
echo "$user";
if (!$ch) {
die("Couldn't initialize a cURL handle");
}
$ret = curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_POSTFIELDS, "username=$user&password=$password&to=$mobilenumbers&sender=$senderid&message=$message");
$ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$curlresponse = curl_exec($ch);
if (curl_errno($ch))
echo 'curl error : ' . curl_error($ch);
if (empty($ret)) {
die(curl_error($ch));
curl_close($ch);
} else {
$info = curl_getinfo($ch);
curl_close($ch);
echo $curlresponse;
}
}
?>