当前位置: 首页>>代码示例>>PHP>>正文


PHP Dao::getUser方法代码示例

本文整理汇总了PHP中Dao::getUser方法的典型用法代码示例。如果您正苦于以下问题:PHP Dao::getUser方法的具体用法?PHP Dao::getUser怎么用?PHP Dao::getUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dao的用法示例。


在下文中一共展示了Dao::getUser方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: htmlspecialchars

	<script src="js/script.js"></script>
	<script src="js/view.js"></script>

</head>
<?php 
session_start();
include "timezone.php";
require_once "Dao.php";
$here = "view.php";
date_default_timezone_set("UTC");
$dao = new Dao();
$row = $dao->getLogin();
if (!$row) {
    header("Location: index.php");
}
$user = $dao->getUser($row["user_id"]);
$events = $dao->getUserEvents($user["id"]);
?>
<body>
<?php 
require_once "header.php";
?>

<div class="h2Wrap">
	<h2>
		<?php 
echo htmlspecialchars($user["username"]);
?>
's Events
	</h2>
</div>
开发者ID:LinkofOrigin,项目名称:DestinySherpaGroups,代码行数:31,代码来源:view.php

示例2: clean_input

<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . "/resources/Dao.php";
$dao = new Dao();
$user = $dao->getUser($_SESSION["email"]);
$user_id = $user["id"];
$content = clean_input($_POST["content"]);
$post_id = $_POST["post_id"];
$id = $dao->saveComment($user_id, $post_id, $content);
function clean_input($data)
{
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
}
?>

<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="refresh" content="0; url=<?php 
echo $_SERVER['HTTP_REFERER'];
?>
" />
</head>
<body>
  <h1>
  </h1>
开发者ID:nickbender,项目名称:metacode,代码行数:31,代码来源:new-comment.php

示例3: Dao

<?php

session_start();
include "timezone.php";
require_once "Dao.php";
date_default_timezone_set("UTC");
$dao = new Dao();
$row = $dao->getLogin();
$sherpa = $dao->getUser($row["user_id"]);
$createConsole = $_POST["createConsole"];
if ($createConsole === "1") {
    $createConsole = "PS3";
} else {
    if ($createConsole === "2") {
        $createConsole = "X360";
    } else {
        if ($createConsole === "3") {
            $createConsole = "PS4";
        } else {
            if ($createConsole === "4") {
                $createConsole = "X1";
            } else {
                $createConsole = "ERR";
            }
        }
    }
}
$createActivity = $_POST["createActivity"];
$createDateTime = $_POST["createDate"] . " " . $_POST["createTime"];
$createOther = $_POST["createOther"];
if ($createConsole === "ERR" || empty($createActivity) || empty($createDateTime)) {
开发者ID:LinkofOrigin,项目名称:DestinySherpaGroups,代码行数:31,代码来源:createEvent.php

示例4:

} else {
    if (!preg_match("/([\\w\\-]+\\@[\\w\\-]+\\.[\\w\\-]+)/", $email)) {
        $_SESSION["form_errors"] = true;
        $_SESSION["email_error"] = "A valid email is required";
        $_SESSION["email"] = $email;
    }
}
if (empty($_POST["password"])) {
    $_SESSION["form_errors"] = true;
    $_SESSION["password_error"] = "A password is required";
    $_SESSION["email"] = $email;
} else {
    $password = $pass->crypt_pass($_POST['password']);
}
if ($_SESSION["password_error"] === "") {
    $user = $dao->getUser($email);
    if (is_null($user["email"])) {
        $_SESSION["form_errors"] = true;
        $_SESSION["email_error"] = "Account not found";
        $_SESSION["email"] = $email;
    } else {
        if ($pass->is_password_correct($user, "{$password}")) {
            $_SESSION["name"] = $user["first"];
            $_SESSION["email"] = $email;
            $_SESSION["user_id"] = $user["id"];
        } else {
            $_SESSION["form_errors"] = true;
            $_SESSION["password_error"] = "Invalid password";
            $_SESSION["email"] = $email;
        }
    }
开发者ID:nickbender,项目名称:metacode,代码行数:31,代码来源:signin.php

示例5: Dao

	<script src="js/jquery.js"></script>
	<script src="js/script.js"></script>
	<script src="js/account.js"></script>
</head>
<?php 
session_start();
require_once "Dao.php";
require_once "User.php";
$here = "account.php";
date_default_timezone_set("UTC");
$dao = new Dao();
$row = $dao->getLogin();
if (!$row) {
    header("Location: index.php");
}
$userData = $dao->getUser($row["user_id"]);
$user = new User($userData["username"]);
$PS3 = $userData["console"] === "PS3" ? " active" : "";
$X360 = $userData["console"] === "X360" ? " active" : "";
$PS4 = $userData["console"] === "PS4" ? " active" : "";
$X1 = $userData["console"] === "X1" ? " active" : "";
if (isset($_SESSION["account_updateFail"]) && !empty($_SESSION["account_updateFail"])) {
    $PS3 = "";
    $X360 = "";
    $PS4 = "";
    $X1 = "";
    if ($_SESSION["account_updateConsole"] === 1) {
        $PS3 = " active";
    } else {
        if ($_SESSION["account_updateConsole"] === 2) {
            $X360 = " active";
开发者ID:LinkofOrigin,项目名称:DestinySherpaGroups,代码行数:31,代码来源:account.php

示例6: htmlspecialchars

        if ($filterConsole === "3") {
            $filterConsole = "PS4";
        } else {
            if ($filterConsole === "4") {
                $filterConsole = "X1";
            } else {
                $filterConsole = "*";
            }
        }
    }
}
$filterActivity = $_POST["activity"];
$filterDateTime = $_POST["dateTime"];
$filterResult = $dao->filterEvents($filterConsole, $filterActivity, $filterDateTime);
foreach ($filterResult as $event) {
    $sherpa = $dao->getUser($event["sherpa"]);
    $activity = $dao->getActivity($event["activity"]);
    ?>
	<a class="eventWrap" href="details.php?id=<?php 
    echo $event["id"];
    ?>
">
		<div class="event">
			<div class="eventSherpa">
				<div class="eventConsole">
					<div class="event<?php 
    echo $event["console"];
    ?>
 consoleMini">
						<?php 
    echo htmlspecialchars($event["console"]);
开发者ID:LinkofOrigin,项目名称:DestinySherpaGroups,代码行数:31,代码来源:filter.php

示例7: Dao

<?php

session_start();
require_once "Dao.php";
require_once "User.php";
date_default_timezone_set("UTC");
$dao = new Dao();
$row = $dao->getLogin();
if (!$row) {
    header("Location: index.php");
}
$userRow = $dao->getUser($row["user_id"]);
$username = $userRow["username"];
$password = $userRow["password"];
$console = $_POST["accountConsole"];
if ($console === "1") {
    $console = "PS3";
} else {
    if ($console === "2") {
        $console = "X360";
    } else {
        if ($console === "3") {
            $console = "PS4";
        } else {
            if ($console === "4") {
                $console = "X1";
            } else {
                $console = "ERR";
            }
        }
    }
开发者ID:LinkofOrigin,项目名称:DestinySherpaGroups,代码行数:31,代码来源:accountEdit.php

示例8: Dao

<?php

session_start();
require_once "Dao.php";
$dao = new Dao();
$email = isset($_POST["email"]) ? $_POST["email"] : "";
$pass = isset($_POST["pass"]) ? $_POST["pass"] : "";
$count = $dao->getUser($email, $pass);
// If result matched $myusername and $mypassword, table row must be 1 row
if ($count != null) {
    $_SESSION["access_granted"] = true;
    $_SESSION["email"] = $email;
    $dao->saveLogOn($email);
    header("Location:myprofile.php");
} else {
    $count = $dao->getUser($email, $pass);
    $status = "Invalid username or password";
    $_SESSION["status"] = $status;
    $_SESSION["email_preset"] = $_POST["email"];
    $_SESSION["access_granted"] = false;
    header("Location:login.php");
}
开发者ID:antoniodebaca,项目名称:foreclosure,代码行数:22,代码来源:login_handler.php


注:本文中的Dao::getUser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。