本文整理汇总了PHP中logged_in_redirect函数的典型用法代码示例。如果您正苦于以下问题:PHP logged_in_redirect函数的具体用法?PHP logged_in_redirect怎么用?PHP logged_in_redirect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logged_in_redirect函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin_only
function admin_only($user_data)
{
// Chris way
$gotAccess = is_admin($user_data);
if ($gotAccess == false) {
logged_in_redirect();
exit;
}
}
示例2: logged_in_redirect
<?php
include 'core/init.php';
logged_in_redirect();
include 'includes/overall/header_register.php';
if (empty($_POST) === false) {
$required_fields = array('username', 'password', 'password_again', 'name', 'mobile', 'email');
foreach ($_POST as $key => $value) {
if (empty($value) && in_array($key, $required_fields) === true) {
$errors[] = 'Fields marked with an asterisk are required';
break 1;
}
}
}
if (empty($errors) === true && empty($_POST) === false) {
$mob = "/^[789][0-9]{9}\$/";
if (!preg_match($mob, $_POST['mobile'])) {
$errors[] = 'Mobile number can only have numbers.';
} else {
if (user_exists($_POST['username']) === true) {
$errors[] = 'Sorry, the username \'' . $_POST['username'] . '\' is already taken.';
} else {
if (preg_match("/\\s/", $_POST['username']) == true) {
$errors[] = 'Your username must not contain any spaces.';
} else {
if (strlen($_POST['password']) < 6) {
$errors[] = 'Your password must be atleast 6 characters.';
} else {
if (trim($_POST['password']) !== trim($_POST['password_again'])) {
$errors[] = 'Your passwords do not match.';
} else {
示例3: logged_in_redirect
<?php
require_once 'core/init.php';
logged_in_redirect($con);
$page_code = 121;
//Fixed Page Code
require_once 'core/page_setup.php';
require_once 'ap/script/login_script.php';
//call login_script in top of page ;
require_once 'includes/all_header.php';
?>
<section class="page_head_bg">
<div class="container" style="padding-top:150px">
<div class="row" >
<div class="col-md-8 col-sm-8 col-xs-9 hidden-xs">
<div class="row"><?php
//require_once 'includes/breadcrumbs.php';
?>
</div>
</div>
<div class="col-md-4 col-sm-4 col-xs-3 text-right">
<div class="row"><p class="page_title_style">Sign in</p></div>
</div>
</div>
</div>
</section><br><br>
<div class="container">
<div class="row">
<div class="col-md-4 col-md-offset-4 text-center">