• 71919阅读
  • 3回复

[程序设置问题]pw8.7更换短信平台的解决方法 [复制链接]

上一主题 下一主题
离线太史慈
 

发帖
777
金币
626
威望
556
只看楼主 倒序阅读 使用道具 楼主  发表于: 2013-11-26
现在第三方短信平台的运营商也很多,但是稳定的不多,我找了一家,还算稳定。
网址是http://www.sioo.com.cn这家,不过测试下来发现、移动的这几天发不了信息、可能是移动那边给限制了。

pw8.x程序里面要对应修改下,修改方法如下:
register.php
找到
  1. echo $status ? 0 : 5;

改成
  1. echo $status;

找到
  1. !$status && Showmsg('手机验证码填写错误');

改成
  1. $status && Showmsg('手机验证码填写错误');

当然、懂代码的会发现,我把这里的判断方式改反了,不要慌、下个文件里面还要修改呢。

打开lib/user/authentication.class.php
找到
  1. function getverify($bev, $mobile, $markid, $issendtocredit = false, $messagetype = '') {

把这个函数整体替换成
  1. //获取验证码
  2.     function getverify($bev, $mobile, $markid, $issendtocredit = false, $messagetype = '') {
  3.         //验证是否是手机
  4.         //if(!preg_match("/^13[0-9]{1}[0-9]{8}$|15[0189]{1}[0-9]{8}$|18[789]{1}[0-9]{8}$/",$mobile)){
  5.         if(!$mobile || !preg_match("/^1[358]{1}[0-9]{9}$/",$mobile)){
  6.         //if(strlen($mobile) != 11) { ///^[1][3,5,8][0-9]{9}$/
  7.             return 2;
  8.         }
  9.         //验证号码是否已经被注册
  10.         global $db, $onlineip, $tdtime;
  11.         $check = $db->get_one("SELECT * FROM pw_members WHERE authmobile='".$mobile."'");
  12.         if($check['uid']) {
  13.             return 3;
  14.         }
  15.         //验证次数
  16.         $count = $db->get_value("SELECT count(*) FROM pw_member_authentication_code WHERE mobile = '".$mobile."' AND time > '".get_date($tdtime)."'");
  17.         if($count >= 2) {
  18.             return 4;
  19.         }
  20.         //生成验证码并记入session
  21.         session_start();
  22.         $code = '';
  23.         $list = '1234567890';
  24.         $len  = strlen($list) - 1;
  25.         $num = 6;
  26.         for ($i = 0; $i < $num; $i++) {
  27.             $code .= $list[mt_rand(0, $len)];
  28.         }
  29.         $_SESSION['auth'.$mobile] = $code;
  30.         //之前是记录session
  31.         $pwSQL = S::sqlSingle(array(
  32.             'mobile'    => $mobile,
  33.             'code'      => $code,
  34.             'ip'        => $onlineip,
  35.             'time'        => get_date($GLOBALS['timestamp'],'Y-m-d H:i:s')
  36.         ));
  37.         $db->update("INSERT INTO pw_member_authentication_code SET ".$pwSQL);
  38.         //发送短消息
  39.         $msg = rawurlencode("手机户注册验证码:".$code.",请在注册页面填写,短信验证码有效期20分钟");
  40.         require_once (R_P . 'require/posthost.php');
  41.         //$data = PostHost("http://210.5.158.31/hy?", "uid=80072&auth=4e2c68e27363ec7ec1ab62a19a7fa00d&mobile=".$mobile."&msg=".$msg."&expid=0&encode=gbk", "GET");
  42.         $data = file_get_contents("http://210.5.158.31/hy?uid=80072&auth=4e2c68e27363ec7ec1ab62a19a7fa00d&mobile=".$mobile."&msg=".$msg."&expid=0");
  43.         list($status,) = explode(',', $data);
  44.         return $status;
  45.     }

找到
  1. function checkverify($mobile, $markid, $verify) {

整体替换成
  1. //校验验证码
  2.     function checkverify($mobile, $markid, $verify) {
  3.         if(!$mobile) {
  4.             $status = 2;
  5.             return $status;
  6.         }
  7.         global $db, $onlineip;
  8.         $code = $db->get_value("SELECT code FROM pw_member_authentication_code WHERE mobile='".$mobile."' AND ip='".$onlineip."' ORDER BY time DESC LIMIT 1");
  9.         //session_start();
  10.         //if($_SESSION['auth'.$mobile] && $verify == $_SESSION['auth'.$mobile]) {
  11.         if($code && $verify == $code) {
  12.             $status = 0;
  13.         } else {
  14.             $status = 5;
  15.         }
  16.         return $status;
  17.     }



[url=http://www.phpwind.com]phpwind[/url]
离线太史慈

发帖
777
金币
626
威望
556
只看该作者 沙发  发表于: 2013-11-26
数据表结构,以后数据不是存云平台了,而是放到本地。
  1. CREATE TABLE IF NOT EXISTS `pw_member_authentication` (
  2.   `uid` int(10) unsigned NOT NULL COMMENT 'uid',
  3.   `username` varchar(20) NOT NULL COMMENT '用户名',
  4.   `alipay` varchar(50) NOT NULL DEFAULT '' COMMENT '支付宝',
  5.   `alipayname` varchar(20) NOT NULL DEFAULT '' COMMENT '支付宝真实姓名',
  6.   `authmobile` char(16) NOT NULL COMMENT '手机',
  7.   `authtime` int(10) NOT NULL COMMENT '认证时间',
  8.   `regip` varchar(40) NOT NULL DEFAULT '' COMMENT '注册ip',
  9.   `type` tinyint(1) NOT NULL COMMENT '绑定来源'
  10. ) ENGINE=MyISAM DEFAULT CHARSET=gbk;
  11. -- --------------------------------------------------------
  12. --
  13. -- 表的结构 `pw_member_authentication_code`
  14. --
  15. CREATE TABLE IF NOT EXISTS `pw_member_authentication_code` (
  16.   `id` int(10) NOT NULL AUTO_INCREMENT,
  17.   `mobile` char(16) NOT NULL,
  18.   `code` char(10) NOT NULL,
  19.   `ip` varchar(40) NOT NULL,
  20.   `time` datetime NOT NULL,
  21.   PRIMARY KEY (`id`),
  22.   KEY `mobile` (`mobile`)
  23. ) ENGINE=MyISAM  DEFAULT CHARSET=gbk;
[url=http://www.phpwind.com]phpwind[/url]
离线cixinet

发帖
44
金币
8
威望
9
只看该作者 板凳  发表于: 2013-11-27
工信部整治垃圾短信给整的
离线willyin510

发帖
59
金币
91
威望
8
只看该作者 地板  发表于: 2013-11-27
Ray Ban Online Store SVIMCB5820 OQYP499863
january 30,http://www.instant-radio-codes.com/monclerukshop.php
Joe Hutchinson and the Rev. Frank Carl. Having said that,http://cmgp.org.uk/cheapmoncleruk.php, due to the fact Google owns YouTube and it is interested in advertising this massive video sharing website,http://www.musictechfest.org/replicacanadagoose.php, relevant videos are often immediately promoted to the to start with webpage of Googles internet search engine final results. Additionally,http://www.candlestickpress.co.uk/canadagooseonsale.php, whilst Google is cracking down on prevalent internet site promotion methods such as short article submission and website link constructing,http://www.giselagraham.co.uk/canadagooseukoutlet.php, its not presently penalizing webmasters that are employing online video advertising to promote their websites..
This time the French gave a Gallic shrug as Sarko ran against his exopponent expartner and father of her four children. Thomas Hollande,http://www.candlestickpress.co.uk/canadagooseuk.php, their 27yearold son,http://www.instant-radio-codes.com/replicamoncler.php, worked for his mom in 2007 and his dad this goround. In one test,http://www.giselagraham.co.uk/replicacanadagoose.php, participants were put in two rooms and given some money and a series of simple math questions. They were told to pay themselves every time they got a right answer.Those in the darker room gave themselves more money than they deserved.
Kors: With accessories and clothes,http://www.baker-richards.com/canadagoosesale.php, first I have to fall in love with whatever it is,http://www.baker-richards.com/canadagooseoutlet.php, but then I get practical. Is the bag too heavy? Can you wear a bra with the dress? With beauty,http://www.giselagraham.co.uk/fakecanadagoose.php, its more of a quick mood check. The question,http://www.instant-radio-codes.com/wholesalemoncler.php, which burned so dimly that no one seemed interested in the answer,http://www.giselagraham.co.uk/canadagooseuksale.php, was "Why Sammy Hagar?" Or perhaps,http://www.musictechfest.org/cacanadagoosemens.php, "How Sammy Hagar?" With every strut he performed an open ended mating dance,http://www.musictechfest.org/canadagoosejackets.php, the middling vintage of his sexuality now aged to vinegar. He drank from offered bottles of liquor,http://www.candlestickpress.co.uk/canadagoosesaleuk.php, coyly discouraged front row flashers,http://www.instant-radio-codes.com/moncleruk.php, and brandished around his neck the plastic chintz of the RNC merch tables..
Wearing thick sunglasses and a badge that announces his vision impairment,http://www.baker-richards.com/canadagooseuk.php, [Sam] Loxton declared flippantly: "Im not going blind,http://www.musictechfest.org/womencanadagoose.php, its just that I cant see." As he looks towards proceedings in the middle from the comfort of the SCG Trust box he relies on his mates [Arthur] Morris and [Neil] Harvey for commentary. And how they relished sharing the news of VVS Laxmans batting on Thursday..
The direct anterior hip replacement technique utilizes a muscle interval in front of the hip joint where muscles and tendons are not cut for joint exposure. It has some added benefits: total hip joint replacement and reconstruction,http://www.baker-richards.com/cheapcanadagoose.php, it allows the surgeon to make a smaller surgical incision (leading to less blood loss,http://www.candlestickpress.co.uk/cacanadagooseoutlet.php, scarring,http://www.musictechfest.org/canadagooseoutletuk.php, and tissue damage),http://www.giselagraham.co.uk/canadagooseonline.php, and muscles surrounding the hip joint are separated at intervals that naturally occur within the tissue (muscles are not cut so patients do not have to heal from surgical trauma as well).
相关的主题文章:

  
   [url=http://cylyw.gov.cn/bbs/forum.php?mod=viewthread
快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
提到某人:
选择好友
上一个 下一个