本帖最后由 hehu158 于 2014-10-24 09:09
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="您的驗證碼是:【變量】。請不要把驗證碼泄露給其他人。如非本人操作,可不用理會!";
$send_content=str_replace("【變量】",$send_content,$sms_template);
//替換成自己的測試賬號,參數(shù)順序和wenservice對應(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);
//增加到本地數(shù)據(jù)庫
$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.3566t.cn網(wǎng)站注冊賬號,后臺配置接口設(shè)置
綁定ip(選填)可以填寫自己網(wǎng)站的ip地址,保證你在調(diào)用短信接口時的安全性,不懂的可以咨詢在線客服; ![]()
圖1-1 接口設(shè)置
3、phpcms后臺設(shè)置
模塊(頂端)—短信平臺(左側(cè))—平臺設(shè)置,輸入你在短信通平臺中注冊的賬號跟密碼(接口設(shè)置中的接口密碼,注意不是賬號的登陸密碼)。
![]()
圖1-2 phpcms后臺短信通短信接口設(shè)置
二、個性化設(shè)置(***非必要***) |
友情鏈接:106短信平臺 | 發(fā)短信平臺 | 短信接口平臺 | 短信接口平臺哪個好 | 國際短信 | 短信通 | 短信接口應(yīng)用
關(guān)于我們 | 產(chǎn)品與服務(wù) | 解決方案 | 客戶案例 | 聯(lián)系我們 | 幫助指南 | 付款方式
Copyright © 2008-2018 短信通 . 速度網(wǎng)絡(luò)有限公司 短信接口應(yīng)用第一平臺 All rights reserved. 浙ICP備10040624號-2