时间:2021-07-01 10:21:17 帮助过:13人阅读
$x = md5($row['userid']."+".$row['pwd']);$str = base64_encode($row['userid'].".".$x);//print_r($str);die;$b=explode("/",DEDEROOT);$c=$b['1'];$a ='/reg/resetpw.php?p='.$str;$a = "$c.$a";
如果你的php版本在5.4及5.4以上的话,你的这段代码
$b=explode("/",DEDEROOT);
$c=$b['1'];
可以简化为
$c=explode("/",DEDEROOT)[1];
list($b,$c,$d)=explode("/",DEDEROOT);$a ='/reg/resetpw.php?p='.base64_encode($row['userid'].".".md5($row['userid']."+".$row['pwd']));$a = "$c.$a";
如果你的php版本在5.4及5.4以上的话,你的这段代码
$b=explode("/",DEDEROOT);
$c=$b['1'];
可以简化为
$c=explode("/",DEDEROOT)[1];
饿 php版本没有达到要求。
没别的办法?
list($b,$c,$d)=explode("/",DEDEROOT);$a ='/reg/resetpw.php?p='.base64_encode($row['userid'].".".md5($row['userid']."+".$row['pwd']));$a = "$c.$a";
$x = md5($row['userid']."+".$row['pwd']);$str = base64_encode($row['userid'].".".$x);$b=explode("/",DEDEROOT);$a ='/reg/resetpw.php?p='.$str;$a = "".$b[1].$a."";
$x = md5($row['userid']."+".$row['pwd']);$str = base64_encode($row['userid'].".".$x);$b=explode("/",DEDEROOT);$a ='/reg/resetpw.php?p='.$str;$a = "".$b[1].$a."";
$x = md5($row['userid']."+".$row['pwd']);$str = base64_encode($row['userid'].".".$x);$b=explode("/",DEDEROOT);$a ='/reg/resetpw.php?p='.$str;$a = "".$b[1].$a."";
$x = md5($row['userid']."+".$row['pwd']);$str = base64_encode($row['userid'].".".$x);$b=explode("/",DEDEROOT);$a ='/reg/resetpw.php?p='.$str;$a = "".$b[1].$a."";
不要太过于简化,因为那会导致PHP 版本兼容性??
???量就少了
$x = md5($row['userid']."+".$row['pwd']);$x = base64_encode($row['userid'].".".$x);//print_r($x);die;$b=explode("/",DEDEROOT);$b = "{$b['1']}./reg/resetpw.php?p={$x}";echo '',var_dump($b),'';
strtok(DEDEROOT, "/");$a ='/reg/resetpw.php?p=' . base64_encode($row['userid'].".".md5($row['userid']."+".$row['pwd']));$a = "".strtok("/")."$a";