當前位置: 首頁>>代碼示例>>PHP>>正文


PHP USER::getAllUsers方法代碼示例

本文整理匯總了PHP中USER::getAllUsers方法的典型用法代碼示例。如果您正苦於以下問題:PHP USER::getAllUsers方法的具體用法?PHP USER::getAllUsers怎麽用?PHP USER::getAllUsers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在USER的用法示例。


在下文中一共展示了USER::getAllUsers方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: session_start

<?php

require_once "src/connection.php";
session_start();
if (isset($_SESSION['user']) == false) {
    header("loacation: login.php");
}
$y = USER::getAllUsers();
echo '<pre>';
var_dump($y);
echo '</pre>';
foreach ($y as $user) {
    echo "{$user->getid()} <br> {$user->getEmail()}<br>";
}
開發者ID:TomaszKawalkowski,項目名稱:Twitter_workshop,代碼行數:14,代碼來源:test.php

示例2: dirname

<?php

require_once dirname(dirname(__FILE__)) . '/config.php';
require SITE_ROOT . '/PHP/User.php';
require SITE_ROOT . '/PHP/check_logged_in.php';
$t = $_SESSION['user']->getIsAdmin();
if ($t != true) {
    $_SESSION['user']->logout();
    header('Location: ' . SITE_LOGIN_PAGE);
}
$users = USER::getAllUsers();
$message = '';
$message_class = 'hidden';
/*
	Determines what is input into the form and creates
	a new user, upon success, the user will be created
	and success will be written on the screen

	The second part of the case is if a user is deleted
	upon success, the user will be removed from the database
	and success will be written on the screen
*/
if (isset($_POST['form'])) {
    switch ($_POST['form']) {
        case 'AddUser':
            try {
                if (isset($_POST['admin'])) {
                    $admin = true;
                } else {
                    $admin = false;
                }
開發者ID:akelleher,項目名稱:taxi-app,代碼行數:31,代碼來源:Admin.php


注:本文中的USER::getAllUsers方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。