我用这段代码将OTP发送给给定的号码。但不能发短信。如何解决这个问题..。
PHP代码
<?php
require_once ('smartysettings.php');
require_once ('class/User.php');
require_once ('class/Sms.php');
require_once ('class/RandomNumber.php');
$number = $_POST['mobnum'];
$result = @User::GetUserIdORMobile($number);
if($result->database->rows = 1)
{
$otp = RandomNumber(10);
$message = "Your OTP(One Time Password) is '$otp'";
$sender = 'Minveedu';
//print_r($otp); exit;
@Sms::SmsSend($number,$message,$sender);
}
?>发送SMS PHP代码的主要类文件
<?php
require_once ('textlocal.class.php');
class Sms
{
var $sms;
var $textloc;
public function __construct()
{
$this->textloc = new Textlocal('*******************', '****************');
}
public static function SmsSend($number,$message,$sender)
{
$ins = new self();
$numbers = array($number);
return $ins->textloc->sendSms($numbers,$message,$sender);
}
}
?>如何解决和发送短信。请帮助这个请求。
发布于 2017-05-09 04:34:46
他们自己在php中提供了发送短消息的代码,您可以通过登录到您的帐户找到它,然后导航HELP >> All DOCUMENTATION >>,您将在这里找到复制和粘贴代码部分。只要通过,它就会起作用
https://stackoverflow.com/questions/42971665
复制相似问题