下面这句代码哪里错了
$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);
<?php
$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);
?>