复制代码 代码如下:
include './config.inc.php';
include './uc_client/client.php';
$usernames="feiye";
$passwords="789123";
list($uid, $username, $password, $email) = uc_user_login($usernames, $passwords);
if($uid > 0) {
setcookie("username",$username,time()+intval(24*3600));
echo uc_user_synlogin($uid);
echo '登录成功';
} elseif($uid == -1) {
echo '用户不存在,或者被删除';
} elseif($uid == -2) {
echo '密码错';
} else {
echo '未定义';
}
复制代码 代码如下:
<script type="text/javascript" src="http://127.0.0.70/api/uc.php?time=1374540644&code=14fdIufn%2B2YwkQlN9P07FEHOfZvDJupvgBgaRPn7R0DJmbEwCb23vKwO1uaeybLq3HZhtokoZrnqu7NGi09jzs684drFCbLDiSpKhk6P50MftBRA3vp4yIswhrPMl1dXo5ajB7CVZ9F8EI%2BkdFfq0E0rdyeRkuz8goeHhg" reload="1"></script>
复制代码 代码如下:
<script type="text/javascript" src="http://127.0.0.71/api/uc.php?time=1374540644&code=07a91g8SepQwwfA3C1uN1sPhC4v6yuER1jFbVTQMK%2BQZmTkjwOz8X%2B8rWgNmKdhlXe9XXVQqAkDjN26CK6BMA19ZpLoiSW4wuNnxHAB9xXLt2VExuyf03MnEHAC%2BUdjwb58sbXGcYUpM4Bmzdm3Q92ObSp0Kk2qCd12fqg" reload="1"></script>
复制代码 代码如下:
function synlogin($get, $post) {
$uid = $get['uid'];
$username = $get['username'];
if(!API_SYNLOGIN) {
return API_RETURN_FORBIDDEN;
}
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
setcookie('gwyy',$username,time()+3600,'/','127.0.0.71');
_setcookie('Example_auth', _authcode($uid."/t".$username, 'ENCODE'));
$_SESSION['username'] = $username;
$_SESSION['uid'] = $uid;
}
function synlogout($get, $post) {
if(!API_SYNLOGOUT) {
return API_RETURN_FORBIDDEN;
}
//note 同步登出 API 接口
header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
_setcookie('Example_auth', '', -86400 * 365);
unset($_SESSION['username']);
unset($_SESSION['uid']);
session_destroy();
}
新闻热点
疑难解答