1. 程式人生 > >discuz ucenter使用者登入介面例項

discuz ucenter使用者登入介面例項

<?php
include '/config/config_ucenter.php';
include "/uc_client/client.php";
if($_GET['act']=='log'){
	list($uid, $username, $password, $email) = uc_user_login($_POST['username'], $_POST['password']);
	if($uid > 0) {
		echo '登入成功';
	} elseif($uid == -1) {
		echo '使用者不存在,或者被刪除';
	} elseif($uid == -2) {
		echo '密碼錯';
	} else {
		echo '未定義';
	}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>無標題文件</title>
</head>

<body>
<form action="?act=log" method="post">
Username:<input type="text" name="username" />
password:<input type="password" name="password" />

<input type="submit" value="submit" />
</form>
</body>
</html>