tp框架:
private function checkAuth()
{$password = C('SERVIE_PASSWOED');//网站的密钥;
if (!empty($_GET)) {
ksort($_GET);
$param = '';
foreach ($_GET as $key => $value) {
if ($key != 'token') {
$param .= $value;
}
}
$param.= $password;
if (md5($param) != $_GET['token']) {
return false;
} else {
if ((time() - $_GET['time']) > 60) {
return false;
}
}
}
return true;
}