Server : nginx/1.22.1
System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64
User : www ( 1000)
PHP Version : 5.6.40
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/www.jkmold.com/api/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/www.jkmold.com/api/sms_idcheck.php
<?php

defined('IN_PHPCMS') or exit('No permission resources.'); 

/**

 * 短信验证接口

 */

 if($_GET['action']=='id_code') {

 	$sms_report_db = pc_base::load_model('sms_report_model');

	$mobile_verify = $_GET['mobile_verify'];

 	if(!$mobile_verify || preg_match("/[^a-z0-9]+/i",$mobile_verify)) exit();

	$mobile = $_GET['mobile'];

	if($mobile){

 		if(!preg_match('/^1([0-9]{10})$/',$mobile)) exit('check phone error');

		$posttime = SYS_TIME-600;

		$where = "`mobile`='$mobile' AND `posttime`>'$posttime'";

		$r = $sms_report_db->get_one($where,'id,id_code','id DESC');

		if($r && $r['id_code']==$mobile_verify) {

			if($_GET['jscheck']!=1) {//验证通过后,将验证码置为空,防止重复利用!

				$sms_report_db->update(array('id_code'=>''),$where);

			}

			exit('1');

		} else {

			exit('0');

		}

	}else{

		/*用户自发短信验证判断,不再传递mobile值,只判断10分钟内这个验证码是否存在,存在即认为此码对应的手机号为你所有*/

		$posttime = SYS_TIME-600;

		$where = "`id_code`='$mobile_verify' AND `posttime`>'$posttime'";

		$r = $sms_report_db->get_one($where,'id_code','id DESC');

		if(is_array($r)){

 			exit('1');

		}else{

			exit('0');

		}

  	}

}