Home > Backend Development > PHP Tutorial > 下面这句代码哪里错了

下面这句代码哪里错了

WBOY
Release: 2016-06-23 14:27:49
Original
929 people have browsed it

$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);
Copy after login


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


回复讨论(解决方案)

$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);
Copy after login

<?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);?>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template