• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SMS类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中SMS的典型用法代码示例。如果您正苦于以下问题:PHP SMS类的具体用法?PHP SMS怎么用?PHP SMS使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SMS类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: buildRequest

 /**
  * Build request string.
  *
  * @param SMS $SMS
  *
  * @return string
  */
 public function buildRequest(SMS $SMS)
 {
     $request = $this->getConfig('url');
     $request .= 'api_key=' . $this->getConfig('key');
     $request .= '&api_secret=' . $this->getConfig('secret');
     $request .= '&from=' . $SMS->getSender();
     $request .= '&to=' . $SMS->getReceiver();
     $request .= '&text=' . urlencode($SMS->getMessage());
     return $request;
 }
开发者ID:makallio85,项目名称:php-sms,代码行数:17,代码来源:Nexmo.php


示例2: send

 public function send($mobile = 8402059135)
 {
     $this->generateOTP();
     $this->_mobile = $mobile;
     $this->_message = 'Your One Time Password for MIS/SIS login is ' . $this->_CODE . '. NIT Silchar 2015.';
     // API call to send sms
     $sms = new SMS();
     if ($sms->send($this->_mobile, $this->_message)) {
         return 1;
     } else {
         echo 'OTP problem please try again later!';
         Session::delete('OTPCode');
         die;
     }
 }
开发者ID:mkrdip,项目名称:Management-Information-System,代码行数:15,代码来源:OTP.php


示例3: sendsmsAction

 function sendsmsAction()
 {
     $currentTime = date("Y-m-d H:i:s");
     $this->_helper->layout->disableLayout();
     if ($this->_request->isPost() && $this->_request->getParam("login_phone") != null) {
         try {
             $login_phone = $this->_request->getParam("login_phone");
             //verify email
             $consumerModel = new Consumer();
             $consumer = $consumerModel->fetchRow("login_phone = '" . $login_phone . "'");
             if ($consumer == null) {
                 $this->view->phoneErr = $this->view->translate('The_phone_is_not_existed');
                 return;
             }
             //generate reset password link
             $codePattern = '1234567890ABCDEFGHIJKLOMNOPQRSTUVWXYZ';
             $signup_auth_code = '';
             for ($codeCount = 0; $codeCount < 12; $codeCount++) {
                 $signup_auth_code = $signup_auth_code . $codePattern[mt_rand(0, 35)];
             }
             $resetPasswordLink = $this->view->home . '/public/forgetpassword/reset/p/' . $signup_auth_code;
             //save link into DB
             $tomorrow = mktime(date("H"), date("i"), date("s"), date("m"), date("d") + 1, date("Y"));
             $expire_date = date("Y-m-d H:i:s", $tomorrow);
             $temporaryLinkModel = new TemporaryLink();
             $temporaryLink = array("link" => $resetPasswordLink, "login_phone" => $login_phone, "expire_date" => $expire_date);
             $temporaryLink_id = $temporaryLinkModel->insert($temporaryLink);
             //send sms
             $newclient = new SMS();
             $mobile = $login_phone;
             $message = $this->view->translate('Forget_Password_SMS') . $signup_auth_code;
             $time = $currentTime;
             $apitype = 2;
             // $apitype 通道选择 0:默认通道; 2:通道2; 3:即时通道;
             $msg = iconv("UTF-8", "GB2312", $message);
             $respxml = $newclient->sendSMS($mobile, $msg, $time, $apitype);
             // crypt the login_phone, added by ZHL on 2011-11-25
             $this->view->crypt_login_phone = substr($login_phone, 0, 3) . "*****" . substr($login_phone, 8, 3);
         } catch (Exception $e) {
             //roll back...
             $this->view->phoneErr = $this->view->translate('Send_fail_Try_Again');
         }
     } else {
         $this->view->phoneErr = $this->view->translate('The_phone_is_not_existed');
     }
     // sms has been sent
     // $this->_helper->redirector('reset', 'forgetpassword');
 }
开发者ID:omusico,项目名称:wildfire_php,代码行数:48,代码来源:ForgetpasswordController.php


示例4: get

 public static function get()
 {
     if (!isset(self::$instance)) {
         self::$instance = new SMS();
     }
     return self::$instance;
 }
开发者ID:carriercomm,项目名称:jbs,代码行数:7,代码来源:SMS.class.php


示例5: sendSMS

 function sendSMS($msgdata)
 {
     $reg_id = parent::registerSMS($msgdata);
     $data = array("key" => $this->api_key, "countrycode" => "BD", "numbers" => $msgdata['to'], "message" => urlencode($msgdata['msg']));
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, "http://bulksms.synergyinterface.com/sms_db/bulk_send_api.php");
     curl_setopt($ch, CURLOPT_POST, 1);
     curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data'));
     curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
     $response = curl_exec($ch);
     curl_close($ch);
     if ($this->debug) {
         echo 'DEBUG:[' . $response . ']';
     }
     $result = json_decode($response);
     if ($result->return == 'true') {
         $status = 1;
     } else {
         $status = 0;
     }
     parent::changeStatus($reg_id, $status);
     return $status;
 }
开发者ID:kaalpurush,项目名称:sms,代码行数:25,代码来源:SynergySMS.php


示例6: send

 public static function send($content, $number = '18608032904')
 {
     if (empty($content)) {
         return false;
     }
     $url = 'http://sms.daoser.com/sms/send/message/' . urlencode($content) . '/phone/' . $number;
     return SMS::get($url);
 }
开发者ID:zt123,项目名称:Base-System,代码行数:8,代码来源:SMS.php


示例7: countSMS

function countSMS($message, $mobile)
{
    $finalMessage = $message;
    $msg_count = 0;
    if (strlen($finalMessage) > 0 && strlen($finalMessage) <= 161) {
        $msg_count = 1;
    } elseif (strlen($finalMessage) > 161 && strlen($finalMessage) <= 307) {
        $msg_count = 2;
    } elseif (strlen($finalMessage) > 307) {
        $msg_count = 3;
    } else {
        echo 'msg not sent';
    }
    $mobileNoCount = count(explode(",", $mobile));
    $field_array = array('created' => date("Y-m-d H:i:s", time()), 'mobile' => $mobile, 'message' => $message, 'count' => $msg_count * $mobileNoCount);
    $medical_sms = new SMS();
    $medical_sms->create($field_array);
    //    $smsCount->create();
}
开发者ID:Akshayf444,项目名称:respi2,代码行数:19,代码来源:functions.php


示例8: run

 public function run()
 {
     $faker = Faker::create();
     User::truncate();
     Phone::truncate();
     SMS::truncate();
     User::create(['name' => 'John', 'email' => '[email protected]', 'password' => 'test', 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'), 'sex' => true, 'city' => $faker->numberBetween(0, 3)]);
     foreach (range(1, 10) as $index) {
         User::create(['name' => $faker->firstName, 'email' => $faker->email, 'birthday' => $faker->date($format = 'Y-m-d', $max = 'now'), 'city' => 2, 'sex' => $faker->boolean(), 'about' => $faker->paragraph($nbSentences = 3), 'password' => 'test']);
     }
 }
开发者ID:SenhorBardell,项目名称:yol,代码行数:11,代码来源:UsersTableSeeder.php


示例9: sendSMS

 public function sendSMS($f3)
 {
     // Set response type
     header('Content-type: application/json');
     // Send SMS
     try {
         $sentMessages = SMS::createAndSend(['recipient_phone_number' => $f3->get('POST.recipient_phone_number'), 'message_content' => $f3->get('POST.message_content')]);
         echo json_encode(['status' => 'OK', 'number_of_messages_sent' => $sentMessages]);
     } catch (Exception $e) {
         echo json_encode(['status' => 'ERR', 'cause' => $e->getMessage()]);
     }
 }
开发者ID:coderay1100,项目名称:sms-gateway,代码行数:12,代码来源:API.php


示例10: loadPlugin

 /**
  * 
  */
 public static function loadPlugin()
 {
     // Get name of plugin to use
     $o_config = Configuration::load();
     $vs_plugin_name = $o_config->get('sms_plugin');
     if (!file_exists(__CA_LIB_DIR__ . '/core/Plugins/SMS/' . $vs_plugin_name . '.php')) {
         die("SMS plugin {$vs_plugin_name} does not exist");
     }
     require_once __CA_LIB_DIR__ . '/core/Plugins/SMS/' . $vs_plugin_name . '.php';
     $vs_plugin_classname = 'WLPlugSMS' . $vs_plugin_name;
     SMS::$plugin = new $vs_plugin_classname();
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:15,代码来源:SMS.php


示例11: post_send

 public function post_send()
 {
     if (is_null(Input::post('to')) || (string) substr(Input::post('to'), 0, 2) != "07") {
         return $this->response(array('status' => 'FAIL', 'message' => 'No valid mobile phone number was given. Please correct this and try again.'));
     }
     if (strlen(Input::post('body')) > 612) {
         return $this->response(array('status' => 'FAIL', 'message' => 'Message was too long, please make sure it is less than 612 characters long.'));
     }
     $sms = SMS::forge();
     $sms->to(Input::post('to'));
     $sms->from(Input::post('from'));
     $sms->body(Input::post('body'));
     $sms->send();
     return $this->response(array('status' => 'SUCCESS', 'message' => 'Message has been sent to ' . Input::post('to') . '.'));
 }
开发者ID:ClixLtd,项目名称:pccupload,代码行数:15,代码来源:sms.php


示例12: sendSMS

 function sendSMS($msgdata)
 {
     $reg_id = parent::registerSMS($msgdata);
     $api = 'http://portals.bd.airtel.com/msdpapi?REQUESTTYPE=SMSSubmitReq&USERNAME=' . $this->api_key . '&PASSWORD=' . $this->api_secret . '&MOBILENO=';
     $api .= $msgdata['to'] . '&MESSAGE=' . urlencode($msgdata['msg']);
     $api .= '&TYPE=0&ORIGIN_ADDR=' . urlencode(isset($msgdata['from']) ? $msgdata['from'] : $this->from);
     $response = file_get_contents($api);
     if ($this->debug) {
         echo 'DEBUG:[' . $response . ']';
     }
     if (preg_match('/Accepted/', $response)) {
         $status = 1;
     } else {
         $status = 0;
     }
     parent::changeStatus($reg_id, $status);
     return $status;
 }
开发者ID:kaalpurush,项目名称:sms,代码行数:18,代码来源:AirtelSMS.php


示例13: MO_SMS_LLEIDA

function MO_SMS_LLEIDA()
{
    mail(DEBUG_EMAIL, SITE_NAME . ". API.PHP MO_SMS_LLEIDA: " . $_SERVER['REMOTE_ADDR'], var_export($_POST, true) . "\n\n--\n\n" . print_r($GLOBALS, true));
    $objSMS = new SMS();
    $objSMS->SETdestino($_POST['destino']);
    $objSMS->SETfecha($_POST['fecha']);
    $objSMS->SETidmo($_POST['idmo']);
    $objSMS->SETorigen($_POST['origen']);
    $objSMS->SETtexto(utf8_encode($_POST['texto']));
    $objSMS->grabar();
    //grabamos un aviso
    $objAviso = new AdministradorAviso();
    $objAviso->SETimagen(NULL);
    $objAviso->SETtexto($_POST['texto']);
    $objAviso->SETtitulo('Nuevo SMS recibido de ' . $_POST['origen']);
    $objAviso->SETurl(BASE_DIR . "admin.php" . "?page=lsSMS");
    $objAviso->SETvisto(0);
    //$objAviso->SETidAdministrador();
    $objAviso->grabarParaTodos();
    //comprobamos si el SMS viene del movil de un cliente y si figura el número de algun pedido de ese cliente
    //que este pendiente de confirmar.
    if (substr($_POST['origen'], 0, 3) == " 34") {
        $arrIdsCli = Cliente::AlltoArray("movil='" . substr($_POST['origen'], 3) . "'", "", "", "arrIds");
        foreach ($arrIdsCli as $idCli) {
            if (Cliente::existeId($idCli)) {
                $objCli = new Cliente($idCli);
                //TODO: imprescindible: estamos usando el id de estado para pendiente de confirmar contrareembolso,
                //esto tendria que cambiar y haber un campo que representase que esta situación
                $arrIdsPed = $objCli->arrPeds("idPedidoEstado='" . 9 . "'", "", "", "arrIds");
                foreach ($arrIdsPed as $idPed) {
                    if (Pedido::existeId($idPed)) {
                        $objPed = new Pedido($idPed);
                        if (strstr($_POST['texto'], $objPed->GETnumero())) {
                            $objPed->cambiarEstado(10);
                        }
                    }
                }
            }
        }
    }
}
开发者ID:neslonso,项目名称:Sintax,代码行数:41,代码来源:appApi.php


示例14: sql_query

    //if(!$row_card['cd_id'])
    sql_query("update {$g4['member_table']} set mb_4 = '" . $row_card['cd_code'] . "' where mb_id = '" . $mb_id . "'");
    $mb_cused = sql_fetch(" select count(*) as cnt from g4_card where mb_id1 = '" . $row_card['mb_id1'] . "' ");
    sql_query(" update {$g4['member_table']} set mb_cused = '" . $mb_cused['cnt'] . "' where mb_id = '" . $row_card['mb_id1'] . "' ");
    $mb_card = sql_fetch("select count(*) as cnt from g4_card where mb_id3 = '{$mb_id}'");
    sql_query("update {$g4['member_table']} set mb_card = '{$mb_card['cnt']}' where mb_id = '{$mb_id}' ");
    //카드추가 부분
    if ($is_sms == "1") {
        if ($_POST[mb_hp]) {
            $get_pe = $_POST[mb_hp];
        } elseif ($_POST[mb_tel]) {
            $get_pe = $_POST[mb_tel];
        } else {
            $get_pe = $_POST[mb_id];
        }
        $sms = new SMS("http://webservice.tongkni.co.kr/sms.3/ServiceSMS.asmx?WSDL");
        $result = $sms->SendSMS("moamoa1234", "yein6510", $str_service_sms, "{$get_pe}", "{$sms_msg}" . PHP_EOL . "" . PHP_EOL . "http://moapoint.kr/");
    }
    insert_groupmember_by_mb_project($mb_id);
    insert_log($mb_id . " 회원을 생성하였습니다.", "c");
} else {
    if ($w == "u") {
        $mb = get_member($mb_id);
        if (!$mb[mb_id]) {
            alert("존재하지 않는 회원자료입니다.");
        }
        if ($is_admin != "super" && $mb[mb_level] >= $member[mb_level]) {
            alert("자신보다 권한이 높거나 같은 회원은 수정할 수 없습니다.");
        }
        if ($_POST[mb_id] == $member[mb_id] && $_POST[mb_level] != $mb[mb_level]) {
            alert("{$mb['mb_id']} : 로그인 중인 관리자 레벨은 수정 할 수 없습니다.");
开发者ID:moacom,项目名称:popay,代码行数:31,代码来源:member_form_update.php


示例15: strlen

        $head = "POST " . $info['path'] . " HTTP/1.0\r\n";
        $head .= "Host: " . $info['host'] . "\r\n";
        $head .= "Referer: http://" . $info['host'] . $info['path'] . "\r\n";
        $head .= "Content-type: application/x-www-form-urlencoded\r\n";
        $head .= "Content-Length: " . strlen(trim($post_string)) . "\r\n";
        $head .= "\r\n";
        $head .= trim($post_string);
        $write = fputs($fp, $head);
        $header = "";
        while ($str = trim(fgets($fp, 4096))) {
            $header .= $str;
        }
        while (!feof($fp)) {
            $data .= fgets($fp, 4096);
        }
        return $data;
    }
}
$config['mobile'] = 18651718003.0;
$config['text'] = "你的验证码是123456";
$sms = new SMS();
// var_dump($sms->send($config));
$res = json_decode($sms->send($config), true);
// var_dump($res);
if ($res['code'] === 0) {
    echo '发送成功';
} else {
    echo '发送失败<br>';
    echo $res['msg'] . '<br>';
    echo $res['detail'];
}
开发者ID:NingerJohn,项目名称:vfinder.cn-ya,代码行数:31,代码来源:SMS.php


示例16: delete

 public static function delete($sms)
 {
     SMS::connectDB();
     DB::set('sms');
     $res = DB::query("DELETE FROM ozekimessagein WHERE id=?", [$sms->id]);
 }
开发者ID:habbes,项目名称:stock-sms,代码行数:6,代码来源:App.php


示例17: testSend

 public function testSend()
 {
     $mobile_code = $this->random(4, 1);
     $content = "您的验证码是:" . $mobile_code . "。请不要把验证码泄露给其他人。";
     $sender = new SMS($this->account, $this->password, $this->mobile, $content);
     $sender->send();
 }
开发者ID:highestgoodlikewater,项目名称:lexiang,代码行数:7,代码来源:SMS.class.php


示例18: SMS

<?php

require_once 'functions.php';
$sms = new SMS();
echo json_encode($sms->unprocessed_remove()) . "\n";
开发者ID:anthrotech,项目名称:oop_phpunitexample,代码行数:5,代码来源:unprocessed_remove.php


示例19: db_connect

}
// ok, if we got to here everything is cool variable-wise
// let's get the data into the db
db_connect();
$query = "INSERT INTO records VALUES (\r\nnull,\r\n'" . sanitize($time_f) . "',\r\n'" . sanitize($light) . "',\r\n'" . sanitize($moisture) . "',\r\n'" . sanitize($wind_dir) . "',\r\n'" . sanitize($wind_spd) . "',\r\n'" . sanitize($pressure) . "',\r\n'" . sanitize($temp) . "',\r\n'" . sanitize($humidity) . "',\r\n'" . sanitize($batt) . "',\r\n'" . sanitize($temp2) . "',\r\n'" . sanitize($rain) . "',\r\n'" . sanitize($light2) . "',\r\n'" . $ip . "')";
mysql_query($query) or die("Could not run query.<br>" . mysql_error());
db_disconnect();
// this header is for the XPORT serin stuff
// ... when we get it working
// ... if ever
header("Zone: D");
// send new header
// check to see if need to send text
if ($sms_on_update) {
    $msgstr = "The station successfully completed an update at " . date("G:i") . ".";
    $newsms = new SMS($c_sms_number, $msgstr, false);
    $newsms->send();
    $params = array();
    $params['dir'] = 'includes';
    $params['include_nested'] = 0;
    $params['search_what'] = '$sms_on_update = true';
    $params['replace_to'] = '$sms_on_update = false';
    $params['file_name_match'] = '/^config.inc.php/';
    // <-- this mean beginning from 'test'
    $replacer = new FileScopeReplacer($params);
    $replacer->doWork();
}
// stupid twit : call with both $light values so it can choose which to use
callTwitter($light, $light2, $temp2, $pressure, $t_hours, $t_mins);
//update to CWOP if enabled in config
if ($c_usecwop) {
开发者ID:jonsowman,项目名称:sgsweather-web,代码行数:31,代码来源:add.php


示例20: auth_check

<?php

$sub_menu = '400400';
include_once './_common.php';
include_once './admin.shop.lib.php';
include_once G5_LIB_PATH . '/mailer.lib.php';
include_once G5_LIB_PATH . '/icode.sms.lib.php';
auth_check($auth[$sub_menu], "w");
define("_ORDERMAIL_", true);
$sms_count = 0;
if ($config['cf_sms_use'] == 'icode' && $_POST['send_sms']) {
    $SMS = new SMS();
    $SMS->SMS_con($config['cf_icode_server_ip'], $config['cf_icode_id'], $config['cf_icode_pw'], $config['cf_icode_server_port']);
}
if ($_FILES['excelfile']['tmp_name']) {
    $file = $_FILES['excelfile']['tmp_name'];
    include_once G5_LIB_PATH . '/Excel/reader.php';
    $data = new Spreadsheet_Excel_Reader();
    // Set output Encoding.
    $data->setOutputEncoding('UTF-8');
    /***
     * if you want you can change 'iconv' to mb_convert_encoding:
     * $data->setUTFEncoder('mb');
     *
     **/
    /***
     * By default rows & cols indeces start with 1
     * For change initial index use:
     * $data->setRowColOffset(0);
     *
     **/
开发者ID:najinsu,项目名称:nsle,代码行数:31,代码来源:orderdeliveryupdate.php



注:本文中的SMS类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP SMTP类代码示例发布时间:2022-05-23
下一篇:
PHP SLA类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap