当前位置:Gxlcms > PHP教程 > 下面这句代码错哪了

下面这句代码错哪了

时间:2021-07-01 10:21:17 帮助过:15人阅读

下面这句代码哪里错了
$aid = 11387;
$_G['uid'] = 332;
$tid =50;
function aidencode($aid, $type = 0, $tid = 0) {
$s = !$type ? $aid.'|'.substr(md5($aid.md5('asdfasfas'.TIMESTAMP.$_G['uid']), 0, 8).'|'.TIMESTAMP.'|'.$_G['uid'].'|'.$tid : $aid.'|'.md5($aid.md5

('asdfasfas').TIMESTAMP).'|'.TIMESTAMP;
return rawurlencode(base64_encode($s));
}


echo aidencode(11387);


麻烦知道的大哥直接给完整代码谢谢了

分享到:


------解决方案--------------------

$aid = 11387;
$_G['uid'] = 332;
$tid =50;
function aidencode($aid, $type = 0, $tid = 0) {
$s = !$type ? $aid.'
------解决方案--------------------
'.substr(md5($aid.md5('asdfasfas'.TIMESTAMP.$_G['uid'])), 0, 8).'
------解决方案--------------------
'.TIMESTAMP.'
------解决方案--------------------
'.$_G['uid'].'
------解决方案--------------------
'.$tid : $aid.'
------解决方案--------------------
'.md5($aid.md5('asdfasfas').TIMESTAMP).'
------解决方案--------------------
'.TIMESTAMP;
return rawurlencode(base64_encode($s));
}
echo aidencode(11387);

------解决方案--------------------

$aid = 11387;
$_G['uid'] = 332;
$tid =50;
define('TIMESTAMP', time());
function aidencode($aid, $type = 0, $tid = 0) {
global $_G;
global $tid;
$s = !$type ? $aid.'
------解决方案--------------------
'.substr(md5($aid.md5('asdfasfas'.TIMESTAMP.$_G['uid'])), 0, 8).'
------解决方案--------------------
'.TIMESTAMP.'
------解决方案--------------------
'.$_G['uid'].'
------解决方案--------------------
'.$tid : $aid.'
------解决方案--------------------
'.md5($aid.md5('asdfasfas').TIMESTAMP).'
------解决方案--------------------
'.TIMESTAMP;
return rawurlencode(base64_encode($s));
}


echo aidencode(11387);
?>

人气教程排行