本文整理汇总了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;
}
示例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>
示例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 '发送完毕';
}