簡體   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