91成人在线播放_欧美一区二区视频在线观看_91精品国产高清久久久久久_国产精品久久亚洲不卡4k岛国


待發(fā)短信

在線客服
產(chǎn)品支持 短信寶客服
合作渠道 渠道合作
服務(wù)咨詢

4001-021-502

工作時(shí)間

9:00-21:00

phpok 5.5新增短信寶短信接口

phpok5.5是一套針對(duì)網(wǎng)站建設(shè)的內(nèi)容管理系統(tǒng),采用 PHP 語(yǔ)言編寫(xiě),默認(rèn)使用 MySQL 數(shù)據(jù)庫(kù)存儲(chǔ),基于 LGPL 開(kāi)源協(xié)議授權(quán)發(fā)布到網(wǎng)上共享使用。小編了解到phpok官方已經(jīng)加入了短信寶插件,今天小編帶大家分析下phpok5.5短信寶短信插件。我們短信寶短信群發(fā)平臺(tái)非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用!

1:打開(kāi)項(xiàng)目:gateway\sms 新建smsbao 文件夾,在smsbao文件夾下創(chuàng)建一個(gè)sendsms.php文件

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
if(!defined("PHPOK_SET")){exit("<h1>Access Denied</h1>");}
$update = $this->get('update');
if($update){
   $mobile = $this->get('mobile');
   if(!$mobile){
      $this->error('未指定手機(jī)號(hào)');
   }
   if(!$this->lib('common')->tel_check($mobile,'mobile')){
      $this->error('手機(jī)號(hào)格式不正式');
   }
   $content = $this->get('content');
   if(!$content){
      $this->error('未指定要發(fā)送的內(nèi)容');
   }
 
   if (empty($rs['ext']['smsbao_user']) || empty($rs['ext']['smsbao_pass']) || empty($rs['ext']['smsbao_sign'])) {
      $this->error('請(qǐng)?zhí)顚?xiě)短信寶用戶名、密碼和簽名');
   
   
   $url = 'http://api.smsbao.com/sms?u='.$rs['ext']['smsbao_user'].'&p='.md5($rs['ext']['smsbao_pass']).'&m='.$mobile.'&c=【'.$rs['ext']['smsbao_sign'].'】'.$content;
 
   $ret = file_get_contents($url);
   
   if($ret == 0){
      $this->success('短信發(fā)送成功');
      return true;
   }
   $this->error($info['message']);
   return false;
}
$this->view($this->dir_root.'gateway/'.$rs['type'].'/sendsms.html','abs-file');

2:打開(kāi)項(xiàng)目:gateway\sms\smsbao 在smsbao文件夾下創(chuàng)建一個(gè)exec.php文件

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
 
if(!defined("PHPOK_SET")){exit("<h1>Access Denied</h1>");}
 
 
if (!$rs['ext'] || !$rs['ext']['smsbao_user'] || !$rs['ext']['smsbao_pass'] || !$rs['ext']['smsbao_sign']) {
   if($this->config['debug']){
      phpok_log(P_Lang('短信寶短信參數(shù)配置不全'));
   }
   return false;
 
if(!$extinfo['mobile'] || !$extinfo['content']){
   if($this->config['debug']){
      phpok_log(P_Lang('手機(jī)號(hào)或短信模版未配置'));
   }
   return false;
}
 
$url = 'http://api.smsbao.com/sms?u='.$rs['ext']['smsbao_user'].'&p='.md5($rs['ext']['smsbao_pass']).'&m='.$extinfo['mobile'].'&c=【'.$rs['ext']['smsbao_sign'].'】'.$extinfo['content'];
 
$ret = file_get_contents($url);
 
if ($ret == 0) {
   return true;
else {
   if($this->config['debug']){
      phpok_log($ret);
   }
   return false;
}

3:打開(kāi)項(xiàng)目:gateway\sms\smsbao 在smsbao文件夾下創(chuàng)建一個(gè)config.xml文件

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?xml version="1.0" encoding="utf-8"?>
<root>
   <title>短信寶短信</title>
   <note>官網(wǎng)(http://www.gjrencai.com)</note>
   <code>
      <smsbao_user>
         <title>短信寶用戶名</title>
         <note>請(qǐng)輸入您在短信寶注冊(cè)的帳號(hào)</note>
         <type>text</type>
         <required>true</required>
      </smsbao_user>
      <smsbao_pass>
         <title>短信寶密碼</title>
         <note>請(qǐng)輸入短信寶密碼</note>
         <type>text</type>
         <required>true</required>
      </smsbao_pass>
      <smsbao_sign>
         <title>短信簽名</title>
         <note>請(qǐng)輸入短信簽名</note>
         <type>text</type>
         <required>true</required>
      </smsbao_sign>
      <mobile>
         <title>手機(jī)號(hào)</title>
         <note>填寫(xiě)管理員接收短信要用到的手機(jī)號(hào),僅支持一個(gè)手機(jī)號(hào)</note>
         <type>text</type>
         <required>true</required>
      </mobile>
   </code>
   <manage>
      <send>
         <title>發(fā)短信</title>
         <exec>sendsms</exec>
         <type>page</type>
      </send>
   </manage>
</root>

經(jīng)過(guò)上面的替換,短信寶的短信平臺(tái)已經(jīng)替換成功了,可以正常使用了。進(jìn)行測(cè)試發(fā)送:

報(bào)備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會(huì)人工審核,短信內(nèi)容3~5秒就可送達(dá)。

另外:我們已經(jīng)開(kāi)發(fā)好完整的phpok5.5系統(tǒng)短信寶插件,點(diǎn)擊此鏈接 下載及查看安裝流程。

開(kāi)源插件

最新更新

電商類

CMS類

微信類

文章標(biāo)簽