繁体   English   中英

如何在php Textlocal.in API上发送短信

[英]How to send SMS on php Textlocal.in api

我已使用此代码在给定号码上发送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);
        }
    }

?>

如何解决和发送短信。 请帮助此请求。

他们自己在php中提供了发送短信的代码,您可以通过登录帐户找到该代码,然后浏览“ 帮助” >>“所有文档” >>在此处找到“复制和粘贴代码”部分。 只是经过它会起作用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM