discuz ucenter的用户注册接口函数

穆嘉
2023-12-01
<?php
include '/config/config_ucenter.php';
include "/uc_client/client.php";
if($_GET["act"]=='log'){
$uid = uc_user_register($_POST['username'], $_POST['password'], $_POST['email']);
	if($uid <= 0) {
		if($uid == -1) {
			echo '用户名不合法';
		} elseif($uid == -2) {
			echo '包含要允许注册的词语';
		} elseif($uid == -3) {
			echo '用户名已经存在';
		} elseif($uid == -4) {
			echo 'Email 格式有误';
		} elseif($uid == -5) {
			echo 'Email 不允许注册';
		} elseif($uid == -6) {
			echo '该 Email 已经被注册';
		} else {
			echo '未定义';
		}
	} else {
		echo '注册成功';
	}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<form action="?act=log" method="post">
<input type="text" name="username" />
<input type="text" name="password" />
<input type="text" name="email" />
<input type="submit" value="submit" />
</form>
</body>
</html>

 类似资料: