本文整理汇总了PHP中UserDao::registerUser方法的典型用法代码示例。如果您正苦于以下问题:PHP UserDao::registerUser方法的具体用法?PHP UserDao::registerUser怎么用?PHP UserDao::registerUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserDao
的用法示例。
在下文中一共展示了UserDao::registerUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UserDao
<?php
require_once '../dao/UserDao.php';
session_start();
$type = @$_POST['ctype'];
$userDao = new UserDao();
if (isset($type)) {
//执行登录操作
if ('login' == $type) {
$arrUsers = $userDao->loginUser(@$_POST['user_name'], @$_POST['user_pwd']);
if ("" != $arrUsers['user_id']) {
//登录成功把信息保存到session
$_SESSION['userLoginMessage'] = $arrUsers;
header("Location: ../../book/view/booklist.php");
} else {
echo "login error!";
}
} else {
if ('register' == $type) {
$rel = $userDao->registerUser(@$_POST['user_name'], @$_POST['user_pwd'], @$_POST['user_email']);
if ($rel) {
echo "注册成功!";
exit;
} else {
echo "注册失败!";
exit;
}
}
}
}
示例2: Connection
</nav>
<!-- header ends here -->
<div class="container margin_top_220">
<?php
if (isset($_POST["submit"])) {
$email = $_POST["email"];
$password = $_POST["password"];
$username = $_POST["username"];
$con = new Connection();
$connection = $con->getConnection();
//$userObject = new User();
//$userObject->setusername($username);
$UserDao_object = new UserDao($connection);
$UserDao_object->registerUser($username, $password, $email);
?>
<p class="bg-primary"><b>
<?php
echo "Registration Successful";
}
?>
</b><br/><a href="index.php">
<button class="btn btn-primary">HOME </BUTTON></a></p>
<div class="footer navbar-fixed-bottom">SmartDocument 2015. All rights reserved.
</div>
</div>
示例3: User
$uid = 1;
require_model('user');
use Qnet\Model\User;
$lastName = "pepe";
$password = "1234";
$birth = "14-11-1940";
$gender = "Male";
$maritalSt = "Single";
$studies = "University";
$InstitutionName = "UA";
$country = "Argentina";
$religion = "Catholic";
$photo = "img08";
$alive = "1";
$user = new User($name, $lastName, $password, $birth, $gender, $maritalSt, $studies, $InstitutionName, $country, $religion, $photo = 'img08', $alive = 1);
$userDao->registerUser($user);
$userUpdated = $userDao->selectUserById($uid);
if ($userUpdated->birth != $user->birth) {
echo " Failed birth";
}
if ($userUpdated->country != $user->country) {
echo " Failed country ";
}
if ($userUpdated->maritalSt != $user->maritalSt) {
echo " Failed maritalSt ";
}
if ($userUpdated->religion != $user->religion) {
echo " Failed religion ";
}
if ($userUpdated->gender != $user->gender) {
echo " Failed gender ";