本文整理匯總了PHP中sys::needLog方法的典型用法代碼示例。如果您正苦於以下問題:PHP sys::needLog方法的具體用法?PHP sys::needLog怎麽用?PHP sys::needLog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類sys
的用法示例。
在下文中一共展示了sys::needLog方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInfo
<?php
/*
* changeInfo.php
* 處理用戶信息修改的邏輯
* Created By C860 at 2014-1-20
*/
//動態加載相關文件
if (file_exists('conf/config.php')) {
$predir = '';
} else {
$predir = '../';
}
include_once $predir . 'conf/config.php';
//需要用戶登錄
sys::needLog($predir . 'login.php');
//引入相關模型類
include_once $predir . 'Models/user_info.php';
/*
* getInfo方法
* 獲取當前用戶信息
* @author C860
* @return array|false
*/
function getInfo()
{
$info = user_info::getUserInfo($_SESSION['userId']);
if ($info != false) {
return $info;
} else {
return false;
示例2: date
<?php
/*
* newArticle.php
* 負責處理新發表文章的邏輯
* Createed By C860 at 2014-1-19
*/
if (!class_exists('sys')) {
include_once '../conf/config.php';
}
//需要登錄
sys::needLog('../login.php');
//檢測數據合法性
if (isset($_POST['title']) && !empty($_POST['title']) && isset($_POST['content']) && !empty($_POST['content']) && isset($_POST['tags']) && !empty($_POST['tags'])) {
//引入相關模型類
include_once '../Models/article.php';
include_once '../Models/tag_relate_article.php';
include_once '../Models/user_info.php';
$currentTime = date('Y-m-d H:i:s');
//新增文章
if (article::add($_POST['title'], $_POST['content'], $currentTime, $_SESSION['userId'])) {
$ID = article::getId($_POST['title'], $_SESSION['userId'], $currentTime);
$tags = explode('|', $_POST['tags']);
foreach ($tags as $tag) {
tag_relate_article::add($tag, $ID);
}
user_info::increaseArticleCount($_SESSION['userId']);
sys::alert('發表成功!');
sys::redirect('../index.php');
}
} else {
示例3: chkform
<?php
include_once 'conf/config.php';
include_once 'Controllers/newArticle.php';
sys::needLog('login.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" type="text/css" href="public/stylesheets/global.css"/>
<link rel="stylesheet" type="text/css" href="public/stylesheets/issue.css"/>
<script type="text/javascript" src="public/javascripts/jquery-1.10.2.js"></script>
<script type="text/javascript" src="public/javascripts/navSlide.js"></script>
<script type="text/javascript" src="public/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="public/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="public/javascripts/key-value.js"></script>
</head>
<body>
<?php
include_once 'menu.php';
?>
<div id="mainBox">
<div id="container">
<form id="newAFrom" onsubmit="return chkform()" class="editor-content" action="Controllers/newArticle.php" method="post">
<div class="editor-header">
<span class="line"></span>
<h2 class="editor-title"> 發表文章</h2>
<input class="issue-title" type="text" name="title" id="title">