Mobile phone verification function for CMS Member Review

Source: Internet
Author: User
Send me the verification method on the mobile phone. Everyone has learned something together. My mobile phone interface uses mobile dream. I have tried other mobile phone interfaces. Almost. Put my interface files under the E/class directory. First, in the member registration page E/template/member/register. php, there are several random 6-digit variables. If you think the 6-digit verification code is not enough, you can modify it. $ Reg = rand (100000,999999); // generate a random 6-digit $ reg_a = base64_encode ($ REG); // encrypt the random 6-digit data and add the mobile phone number field to the Member registry ticket: phome; Verification Code field: YZM, set his value = "$ reg_a" and then open E/class/user. PHP is about 613 lines. Check whether you have activated if ($ checked = 0 & $ public_r ['regacttype'] = 1) {include ('.. /class/qmemberfun. PHP '); sendactuseremail ($ userid, $ username, $ email);} // review if ($ checked = 0) {$ phone = $ _ post [PHONE]; $ YZM =$ _ post [YZM]; $ content = base64_decode ($ YZM); // mengnet SMS platform include_once ('fasong/client. PHP '); $ smsinfo ['server _ url'] = 'HTTP: // ws.montnets.com: 9002/mwgate/wmgw. asmx? WSDL '; $ smsinfo ['user _ name'] = 'dream Username'; $ smsinfo ['Password'] = 'dream user password '; $ smsinfo ['pszsubport'] = '*'; $ content = "your registered platform verification code is {$ content}"; $ mobiles = array ($ phone ); $ SMS = new client ($ smsinfo ['server _ url'], $ smsinfo ['user _ name'], $ smsinfo ['Password']); $ SMS-> pszsubport = $ smsinfo ['pszsubport']; $ SMS-> setoutgoingencoding ("UTF-8"); $ result = $ SMS-> sendsms ($ mobiles, $ content); $ location = "/e/member/editinfo/jihuo. PHP? YZM = $ YZM & phone = $ phone "; // After registering this page, go to the activation page and write it on your own. Printerror ("registersuccesscheck", $ location, 1);} the red part is the verification page. The page is as follows:/e/member/editinfo/jihuo. php. This path, this user name <? PHP $ url = "<a href = .. /.. /.. /> homepage </a> & nbsp; <a href = .. /CP/> Control Panel </a> & nbsp; Modify information "; require (ecms_path. '/e/data/template/cp_1.php'); $ phone =$ _ Get [PHONE]; $ YZM =$ _ Get [YZM]; // $ reg_ B = base64_decode ($ YZM); // echo $ phone; // echo $ reg_ B;?> <Table width = "100%" border = "0" cellspacing = "0" cellpadding = "0"> <tr> <TD Height = "50" bgcolor = "# fff8ed" Class = "logo_tbs"> <Div class = "logo_listclassname"> registered member activation </div> </TD> </tr> <TD class = "logo_tbsxx"> <BR> <Table width = '000000' border = '0' align = 'center' cellpadding = '3' cellspacing = '1' bgcolor = "# ffd5be" class = "tableborder"> <form name = useryanzheng method = post action = "/e/escape/yanzheng. PHP "> // This is the verification code of the mobile phone. <Input type = hidden name = YZM value = <? = $ YZM?> /> <Input type = hidden name = phone value = <? = $ Phone?> /> <Tr> <TD width = "25%" Height = "25" bgcolor = "# ffffff"> mobile phone verification code: </TD> <TD width = "45%" Height = "25" bgcolor = "# ffffff"> <input type = "text" name = "sryzm" id = "sryzm" /> </TD> <TD width = "35%" bgcolor = "# ffffff"> <input type = 'submit 'name = 'submit' value = 'click to authenticate '/> </TD> </tr> </form> </table> <br> </TD> </tr> </table> <? Phprequire (ecms_path. '/e/data/template/cp_2.php');?> The code for this page is as follows. The path is/e/escape/yanzheng. php <? Phprequire (".. /class/connect. PHP "); require (".. /class/db_ SQL .php "); require (".. /class/q_functions.php "); require (".. /data/dbcache/class. PHP "); require loadlang (" pub/Fun. PHP "); $ link = db_connect (); $ empire = new mysqlquery (); $ sryzm =$ _ post [sryzm]; $ phone =$ _ post [PHONE]; $ YZM =$ _ post [YZM]; $ yzm_ B = base64_decode ($ YZM ); $ SQL = $ empire-> query ("select * From fc_enewsmemberadd where phone = '{$ phone}' and YZM = '{$ YZM}'"); $ r = $ Empire-> fetch ($ SQL); $ hl_phone = $ R [PHONE]; $ hl_yzm = $ R [YZM]; $ userid = $ R [userid]; $ updata = $ R [updata]; // echo $ sryzm. "<br> ". $ phone. "<br> ". $ yzm_ B. "<br> ". $ hl_phone. "<br>"; if ($ phone = $ hl_phone & $ sryzm = $ yzm_ B) {$ SQL = $ empire-> query ("Update fc_enewsmember set checked = 1 where userid = '{$ userid}'"); echo "<SCRIPT> alert ('activated successfully! '); Window. location. href = '/e/member/login/index. php'; </SCRIPT> ";}if ($ phone ==$ hl_phone & $ sryzm! = $ Yzm_ B & $ updata <3) {$ SQL = $ empire-> query ("Update fc_enewsmemberadd set updata = updata + 1 where userid = '{$ userid}'"); $ jihui = 2-$ updata; echo $ jihui; echo "<SCRIPT> alert ('phone verification code entered incorrectly! You have another {$ jihui} opportunity. '); Window. Location. href ='/e/member/editinfo/jihuo. php? YZM = {$ YZM} & phone = {$ phone} '; </SCRIPT> "; echo $ updata ;} else {echo "<SCRIPT> alert ('the information you entered is incorrect! '); Window. Location. href ='/e/member/register/index. php? Groupid = 1'; </SCRIPT> ";}db_close (); $ empire = NULL;?> There are only three chances for mobile phone verification. You can add the _ enewsmemberadd and updata fields in this table. From: http://blog.sina.com.cn/s/blog_66a0738b01016gwz.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.