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


PHP confirm_logged_in函数代码示例

本文整理汇总了PHP中confirm_logged_in函数的典型用法代码示例。如果您正苦于以下问题:PHP confirm_logged_in函数的具体用法?PHP confirm_logged_in怎么用?PHP confirm_logged_in使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: confirm_user_is_admin

function confirm_user_is_admin()
{
    confirm_logged_in();
    if ($_SESSION['admin'] != 1) {
        redirect_to("index.php");
    }
}
开发者ID:akiryk,项目名称:storyengine,代码行数:7,代码来源:session.php

示例2: confirm_logged_in

<?php

//if returns yes in sched.php this page will be executed
include '../../config/connection.php';
include '../../config/sy.php';
require '../../auth.php';
confirm_logged_in();
check_level();
$course = $_REQUEST['course'];
$yrlvl = $_REQUEST['yrlvl'];
$sem = $_REQUEST['sem'];
$s = mysql_query("SELECT * FROM scheds WHERE course_id='{$course}' AND yrlvl='{$yrlvl}' AND sem='{$sem}'");
while ($t = mysql_fetch_array($s)) {
    $trappings = mysql_query("SELECT * FROM schedules WHERE `subject_id`='{$t['subject_id']}' AND `course_id`='{$t['course_id']}' AND `section_id`='{$t['section_id']}' OR `time_id`='{$t['time_id']}' AND `room_id`='{$t['room_id']}' AND `sy_id`='{$sy['sy_id']}' AND `sem`='{$sem}' ");
    if (mysql_num_rows($trappings) > 0) {
    } else {
        $insert = mysql_query("INSERT INTO schedules(`sched_id`,`subject_id`,`course_id`,`yrlvl`,`time_id`,`section_id`,`room_id`,`size`,`pop`,`sy_id`,`sem`,`status`)VALUES('','{$t['subject_id']}','{$t['course_id']}','{$t['yrlvl']}','{$t['time_id']}','{$t['section_id']}','{$t['room_id']}','{$t['size']}','{$t['pop']}','{$t['sy_id']}','{$t['sem']}','{$t['status']}')");
    }
}
//$deleteexist=mysql_query("DELETE FROM scheds WHERE EXISTS (SELECT * FROM schedules WHERE scheds.sched_id=schedules.sched_id)");
echo "<meta http-equiv='refresh' content='0; url=classmenu.php'><script>alert('Schedules has been set successfully!')</script>";
开发者ID:pr1nce5tephen,项目名称:officeautomation,代码行数:21,代码来源:confirmation2.php

示例3: confirm_logged_in

<?php

require_once '../_includes/functions.php';
require_once '../_includes/session.php';
require_once '../_includes/connection.php';
require_once '../_includes/headfoot.php';
require_once '_includes/blog_functions.php';
confirm_logged_in(2);
$url = 'comment.php';
if (isset($_GET['page'])) {
    $url .= '?page=' . $_GET['page'];
}
//decided if someone is friendly
is_friendly($_GET['friendly'], $_SESSION['user_name'], $_COOKIE['friendly'], $url);
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
    redirect_to("index.php?error=1");
}
//insert the post into the database
if (isset($_POST['submit'])) {
    $clean_comment = strip_tags($_POST['comment'], '<p><h2><h3><br><a>');
    $html_ready_comment = htmlspecialchars($clean_comment);
    global $connection;
    $query = "INSERT INTO ";
    $query .= " comments (";
    $query .= "author, comment, page_id";
    $query .= ") VALUES (";
    $query .= "'{$_SESSION['user_name']}', '{$html_ready_comment}', '{$_GET['id']}')";
    $result = mysql_query($query, $connection);
    redirect_to('ind_blog.php?page=' . $_GET['id'] . '&msg=1');
}
?>
开发者ID:rcmoret,项目名称:personal_site,代码行数:31,代码来源:comment.php

示例4: confirm_logged_in

<?php

require_once '../_includes/connection.php';
require_once '_includes/header_footer_blog.php';
require_once '../_includes/functions.php';
require_once '_includes/blog_functions.php';
require_once '_includes/session.php';
confirm_logged_in(4);
if (!$_GET['page']) {
    redirect_to("index.php?error=4");
}
$clean_id = mysql_prep($_GET['page']);
if ($page = get_page_by_id($clean_id)) {
    $query = "DELETE FROM pages WHERE id ={$clean_id} LIMIT 1";
    $result = mysql_query($query, $connection);
    if (mysql_affected_rows() == 1) {
        $message = "A single post was deleted.<br />";
        if (get_comments($clean_id, ALL) > 0) {
            $query_comments = "DELETE FROM comments WHERE page_id={$clean_id}";
            mysql_affected_rows();
            if (mysql_affected_rows() == 1) {
                $message .= "And a single comment was deleted.";
            } else {
                $message .= "And " . mysql_affected_rows() . " comments were deleted.";
            }
        }
    } else {
        $message = '<p>Subject Deletion Failed</p>';
    }
}
?>
开发者ID:rcmoret,项目名称:personal_site,代码行数:31,代码来源:delete.php

示例5: confirm_logged_in

<?php

require_once '../_includes/connection.php';
require_once '_includes/header_footer_blog.php';
require_once '../_includes/functions.php';
require_once '_includes/blog_functions.php';
require_once '_includes/session.php';
confirm_logged_in(3);
$url = 'add_post.php';
is_friendly($_GET['friendly'], $_SESSION['user_name'], $_COOKIE['friendly'], $url);
//insert the post into the database
if (isset($_POST['submit'])) {
    global $connection;
    $query = "INSERT INTO ";
    $query .= " pages (";
    $query .= "subject_id, page_name, content, tags, visible, author, draft";
    $query .= ") VALUES (";
    $query .= "4, '{$_POST[page_name]}', '{$_POST['content']}', '{$_POST['tags']}', {$_POST['public']}, '{$_SESSION['user_name']}', {$_POST['draft']})";
    $result = mysql_query($query, $connection);
    redirect_to('index.php');
}
echo $header_blog1;
?>
<link rel= "stylesheet" type = "text/css" href="../blog/_stylesheets/form.css">
<link href='http://fonts.googleapis.com/css?family=Rock+Salt' rel='stylesheet' type='text/css'>
<title>RCM: Add</title>
<?php 
echo $header_blog2;
?>

<body>
开发者ID:rcmoret,项目名称:personal_site,代码行数:31,代码来源:add_post.php


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