當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sms::send_sms方法代碼示例

本文整理匯總了PHP中sms::send_sms方法的典型用法代碼示例。如果您正苦於以下問題:PHP sms::send_sms方法的具體用法?PHP sms::send_sms怎麽用?PHP sms::send_sms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sms的用法示例。


在下文中一共展示了sms::send_sms方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sendsms

 function sendsms()
 {
     $type = $_POST['type'];
     $amt = $_POST['amt'];
     $msg = $_POST['msg'];
     $when = $_POST['when'];
     // get numbers
     if ($type == "thai") {
         $query = $this->db->query('SELECT `id`,`name`,`number` FROM `contact_numbers` WHERE `status` = "1" AND `sent` != "1" LIMIT ' . $amt . '');
     }
     $contacts = $query->result();
     include "/home/www/xxxxxx.com/htdocs/js/sms/sms.class.php";
     $result_message = 'SMS RESULTS<br />';
     //print_r($contacts);
     foreach ($contacts as $c) {
         $username = 'xxxxxx';
         $password = '528051';
         //$username = 'thaibulksms';
         //$password = 'thisispassword';
         $ph = str_replace('+66', '0', $c->number);
         $msisdn = $ph;
         $message = str_replace('**NAME**', $c->name == "" ? '' : $c->name, $msg);
         $message = str_replace('**Name**', $c->name == "" ? '' : $c->name, $message);
         $message = str_replace('**name**', $c->name == "" ? '' : $c->name, $message);
         $sender = 'xxxxxx';
         //$sender = 'THAIBULKSMS';
         $ScheduledDelivery = $when;
         $force = 'standard';
         $result = sms::send_sms($username, $password, $msisdn, $message, $sender, $ScheduledDelivery, $force);
         $result_message .= 'Id: ' . $c->id . ' name: ' . $c->name . ' number: ' . $ph . ' result:' . $result . '<br /><br />';
         // update number
         $query = $this->db->query('UPDATE `contact_numbers` SET `sent` = 1 WHERE `id` = "' . $c->id . '"');
     }
     echo $result_message;
     exit;
 }
開發者ID:Nkelliny,項目名稱:MobileDatingApp,代碼行數:36,代碼來源:ajax.php

示例2:

<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<?php 
include "sms.class.php";
//$username = $_REQUEST['username'];
//$password = $_REQUEST['password'];
$username = 'xxxxxxxxxx';
$password = '528051';
$msisdn = $_REQUEST['msisdn'];
$message = $_REQUEST['message'];
$sender = $_REQUEST['sender'];
$ScheduledDelivery = $_REQUEST['ScheduledDelivery'];
$force = $_REQUEST['force'];
$result = sms::send_sms($username, $password, $msisdn, $message, $sender, $ScheduledDelivery, $force);
echo $result;
?>
</body>
</html>
開發者ID:Nkelliny,項目名稱:MobileDatingApp,代碼行數:21,代碼來源:send_sms.php

示例3: do_bat_sms

 function do_bat_sms()
 {
     $this->model_issn->user_auth();
     $s_num = $this->input->xss_clean($this->input->post('s_num'));
     $content = ico($this->input->xss_clean($this->input->post('content')));
     if ($s_num === 'all') {
         $q = $this->db->get(PHONE_TABLE);
     } else {
         if (!empty($s_num)) {
             $q = $this->db->get(PHONE_TABLE, $s_num, 0);
         } else {
             exit;
         }
     }
     $this->config->load('sms');
     if ($q->num_rows() > 0) {
         foreach ($q->result_array() as $row) {
             $sms_to = $row['phone_no'];
             $re = sms::send_sms($sms_to, $content, $this->config->item('uid'), $this->config->item('pwd'));
             if ($re !== true) {
                 //更新郵件成功率!
             }
         }
     } else {
         die('手機號庫中,沒有任何信息');
     }
     echo '發送完畢';
 }
開發者ID:houzhenggang,項目名稱:mailer,代碼行數:28,代碼來源:mailer.php


注:本文中的sms::send_sms方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。