本文整理汇总了PHP中admin::login方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::login方法的具体用法?PHP admin::login怎么用?PHP admin::login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::login方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
/**
* login for both nurse and admin
*/
function login()
{
$user_type = $_REQUEST['user_type'];
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
if ($user_type == 'admin') {
include '../models/model_admin.php';
$admin = new admin();
$row = $admin->login($username, $password);
if (!$row) {
echo '{"result":0,"message": "Your details as an admin are wrong."}';
return;
}
set_admin_session($row);
echo '{"result":1,"message": "' . $_SESSION['admin_fn'] . ' is logged in"}';
return;
} elseif ($user_type == 'nurse') {
include '../models/model_nurse.php';
$nurse = new nurse();
$row = $nurse->login($username, $password);
if (!$row) {
echo '{"result":0,"message": "Your details as a nurse are wrong."}';
return;
}
set_nurse_session($row);
echo '{"result":1,"message": "' . $_SESSION['nurse_name'] . ' is logged in"}';
return;
}
}
示例2: header
$includeFile = "manageusers";
break;
case "editprofile":
$includeFile = "editprofile";
break;
case "edituser":
if (!$ps->is_admin() && $_REQUEST["username"] != $_SESSION["photostack_user"]->username) {
$adminMessage = "You do not have permission to perform this operation.";
$ps->select_gallery();
$includeFile = "view";
} else {
$includeFile = "edituser";
}
break;
case "login":
if ($ps->login()) {
if ($_POST['forward_url']) {
header("Location: " . $_POST['forward_url']);
}
$ps->select_gallery($_POST['gallery']);
$adminMessage = "Welcome to Organize";
$includeFile = "view";
} else {
$adminMessage = $ps->last_error();
$includeFile = "login";
}
break;
case "logout":
$ps->logout();
$adminMessage = "Thank you and goodbye!";
$includeFile = "login";
示例3: get_report
}
public function get_report($stmt)
{
if ($stmt == 'work or study report') {
$sql = 'select * from research where do_present = "working";';
$res = parent::query($sql, $rows, $num_rows);
if ($res) {
print 'Rows: ' . $num_rows;
} else {
print $res;
}
} else {
}
}
}
$admin = new admin();
if (isset($_POST['dowhat']) && $_POST['dowhat'] == 'login') {
if (!isset($_POST['username']) || !isset($_POST['pwd'])) {
print 'access without username or password';
exit;
}
if (empty($_POST['username']) || empty($_POST['pwd'])) {
print 'username or password is empty';
exit;
}
$admin->username = trim($_POST['username']);
$admin->pwd = trim($_POST['pwd']);
$admin->login();
} elseif (isset($_POST['dowhat']) && $_POST['dowhat'] == 'report') {
$admin->get_report();
}
示例4: vImage
<?php
include $_SERVER['DOCUMENT_ROOT'] . "/common/class/admin/admin.class.php";
include "ImgVerification.php";
$vImage = new vImage();
$vImage->loadCodes();
//include "common/function.php";
if (!$vImage->checkCode()) {
?>
<script>
alert('Please enter the exact value from image');
window.location="login.php";</script><?php
exit;
}
$login = new admin();
$login_status = $login->login($_POST['user'], $_POST['pass']);
//login($_POST['user'],$_POST['pass']);
$check_login = $login->checklogin();
if ($login->checklogin() == true) {
echo "<script> window.location='index.php'; </script>";
} else {
echo "<script> alert('Invalid Username and Password'); window.location='index.php'; </script>";
}
示例5: admin
<?php
// Includng configuration file
include 'config/config.php';
$admin = new admin();
if (!empty($_POST) && isset($_POST['username']) && isset($_POST['password'])) {
$data = $_POST;
if ($admin->login($data)) {
$_SESSION['message'] = 'You have login successfully!';
header('Location: ' . FRONTEND . 'dashboard.php');
exit;
} else {
$_SESSION['message'] = 'Wrong password entered!';
header('Location: ' . FRONTEND . 'index.php');
exit;
}
}
示例6: db
<?php
include 'config.inc.php';
require ABSPATH . '/include/mydb.class.php';
include ABSPATH . '/include/mydir.class.php';
require ABSPATH . '/include/class.category.php';
require ABSPATH . '/include/prompt.class.php';
require ABSPATH . '/include/user.class.php';
require ABSPATH . '/include/function.php';
$db = new db('localhost', 'root', '', 'mycms');
admin::login($db);