1、備份網(wǎng)站根目錄下phpcms\modules\sms\classes\smsapi.class.php
如果此前沒有修改過該文件,直接把phpcms文件夾復(fù)制到根目錄下覆蓋即可;如果之前修改過,需要替換其中send_sms函數(shù)的執(zhí)行代碼:
//短信發(fā)送狀態(tài)
$status = $this->_sms_status();
if(is_array($mobile)){
$mobile = implode(",", $mobile);
}
$content = safe_replace($content);
if(strtolower($charset)=='utf-8') {
$send_content = iconv('utf-8','gbk',$content);//官網(wǎng)IS GBK
}else{
$send_content = $content;
}
$send_time = strtotime($send_time);
$target = "http://sms.106jiekou.com/utf8/sms.aspx";
$sms_template="您的驗(yàn)證碼是:【變量】。請(qǐng)不要把驗(yàn)證碼泄露給其他人。如非本人操作,可不用理會(huì)!";
$send_content=str_replace("【變量】",$send_content,$sms_template);
//替換成自己的測(cè)試賬號(hào),參數(shù)順序和wenservice對(duì)應(yīng)
$data = "account=".$this->userid."&password=".$this->sms_key."&mobile=".$mobile."&content=".rawurlencode($send_content);
$url_info = parse_url($target);
$httpheader = "POST " . $url_info['path'] . " HTTP/1.0\r\n";
$httpheader .= "Host:" . $url_info['host'] . "\r\n";
$httpheader .= "Content-Type:application/x-www-form-urlencoded\r\n";
$httpheader .= "Content-Length:" . strlen($data) . "\r\n";
$httpheader .= "Connection:close\r\n\r\n";
//$httpheader .= "Connection:Keep-Alive\r\n\r\n";
$httpheader .= $data;
$fd = fsockopen($url_info['host'], 80);
fwrite($fd, $httpheader);
$gets = "";
while(!feof($fd)) {
$gets .= fread($fd, 128);
}
fclose($fd);
//增加到本地?cái)?shù)據(jù)庫(kù)
$sms_report_db = pc_base::load_model('sms_report_model');
$send_userid = param::get_cookie('_userid') ? intval(param::get_cookie('_userid')) : 0;
$ip = ip();
$new_content = $content;
if(strpos($gets, "100")) {
$sms_report_db->insert(array('mobile'=>$mobile,'posttime'=>SYS_TIME,'id_code'=>$new_content,'send_userid'=>$send_userid,'status'=>'100','msg'=>$send_content,'return_id'=>$gets,'ip'=>$ip));
} else {
$sms_report_db->insert(array('mobile'=>$mobile,'posttime'=>SYS_TIME,'send_userid'=>$send_userid,'status'=>'-2','msg'=>$new_content,'ip'=>$ip));
}
return $gets;
2、打開http://www.699199.cn網(wǎng)站注冊(cè)賬號(hào),后臺(tái)配置接口設(shè)置
綁定ip(選填)可以填寫自己網(wǎng)站的ip地址,保證你在調(diào)用短信接口時(shí)的安全性,不懂的可以咨詢?cè)诰€客服;
圖1-1 接口設(shè)置
3、phpcms后臺(tái)設(shè)置
模塊(頂端)—短信平臺(tái)(左側(cè))—平臺(tái)設(shè)置,輸入你在短信通平臺(tái)中注冊(cè)的賬號(hào)跟密碼(接口設(shè)置中的接口密碼,注意不是賬號(hào)的登陸密碼)。
圖1-2 phpcms后臺(tái)短信通短信接口設(shè)置
1、簽名個(gè)性化(自定義短信模板目前只針對(duì)短信通vip3用戶開放)
圖2-1 客戶收到的短信默認(rèn)模板之一
進(jìn)入短信通用戶后臺(tái)參考圖2-2將圖2-1紅色框框中的文字改成自己的網(wǎng)站或者企業(yè)名稱。
圖2-2 簽名設(shè)置
2、短信模板個(gè)性化(自定義短信模板目前只針對(duì)短信通vip3用戶開放)
看圖2-1的默認(rèn)短信模板,其實(shí)對(duì)應(yīng)的就是短信通用戶后臺(tái)短信模板中預(yù)設(shè)的其中之一,
看圖2-3的紅框框中的內(nèi)容,普通用戶可以隨意替換成公共短信模板;由于國(guó)家政策以及運(yùn)營(yíng)商網(wǎng)關(guān)審批備案限制等一些原因,vip3用戶個(gè)性化短信模板(即私有短信模板,參考藍(lán)色框框的內(nèi)容)需要先添加模板,備案審核通過后才能使用。
圖2-3 模板設(shè)置
個(gè)性化短信模板通過審核之后,就可以拿來(lái)使用了,這里我們以圖2-3藍(lán)框框中的“您的驗(yàn)證碼:【變量】。如需幫助請(qǐng)聯(lián)系客服。”,假設(shè)已經(jīng)通過審核,網(wǎng)站要讓客戶手機(jī)驗(yàn)證時(shí)收到這個(gè)短信模板的短信,需要修改smsapi.class.php中的$sms_template變量的賦值,即圖2-4中的紅框框中的內(nèi)容替換變成圖2-5的。(普通用戶替換公共短信模板可以參照此操作)
圖2-4 替換個(gè)性化短信模板
圖2-5 個(gè)性化短信模板替換結(jié)果
企業(yè)QQ:4006668280
公司電話:400-666-8280
公司傳真:0577-61587911
郵件咨詢:dxton@qq.com
上班時(shí)間:工作日 9:00-17:00 晚值班 19:30-21:00
友情鏈接:106短信平臺(tái) | 發(fā)短信平臺(tái) | 短信接口平臺(tái) | 短信接口平臺(tái)哪個(gè)好 | 國(guó)際短信 | 短信通 | 短信接口應(yīng)用
關(guān)于我們 | 產(chǎn)品與服務(wù) | 解決方案 | 客戶案例 | 聯(lián)系我們 | 幫助指南 | 付款方式
Copyright © 2008-2018 短信通 . 速度網(wǎng)絡(luò)有限公司 短信接口應(yīng)用第一平臺(tái) All rights reserved. 浙ICP備10040624號(hào)-2