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


PHP redirect_visitor函数代码示例

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


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

示例1: session_start

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
/*
 * Provide a spreadsheet report of all the files
 * 
 */
// check for session and $_REQUEST['id']
session_start();
include '../odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor('../index.php?redirection=reports/file_list.php');
}
// open a connection to the database
$user_obj = new User($_SESSION['uid'], $GLOBALS['connection'], DB_NAME);
// Check to see if user is admin
if (!$user_obj->isAdmin()) {
    header('Location:../error.php?ec=4');
    exit;
}
function cleanExcelData(&$str)
{
    if (strstr($str, '"')) {
        $str = '"' . str_replace('"', '""', $str) . '"';
    }
    $str = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
}
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:31,代码来源:file_list.php

示例2: or

of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
// check session and $id
session_start();
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (!isset($_REQUEST['id']) || $_REQUEST['id'] == '') {
    header('Location:error.php?ec=2');
    exit;
}
draw_header(msg('area_view_history'), $last_message);
//revision parsing
if (strchr($_REQUEST['id'], '_')) {
    list($_REQUEST['id'], $revision_id) = explode('_', $_REQUEST['id']);
}
$datafile = new FileData($_REQUEST['id'], $pdo);
// verify
if ($datafile->getError() != null) {
    header('Location:error.php?ec=2');
开发者ID:msusoko,项目名称:opendocman,代码行数:31,代码来源:history.php

示例3: session_start

along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
// check for valid session and $id
session_start();
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
    redirect_visitor();
}
require_once "AccessLog_class.php";
require_once "File_class.php";
require_once 'Email_class.php';
require_once 'Reviewer_class.php';
$user_obj = new User($_SESSION['uid'], $GLOBALS['connection'], DB_NAME);
if (!$user_obj->canCheckIn()) {
    redirect_visitor('out.php');
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (!isset($_REQUEST['id']) || $_REQUEST['id'] == '') {
    $last_message = 'Failed';
    header('Location:error.php?ec=2&last_message=' . urlencode($last_message));
    exit;
}
// includes
// open connection
if (!isset($_POST['submit'])) {
    // form not yet submitted, display initial form
    // pre-fill the form with some information so that user knows which file is being updated
    $query = "SELECT description, realname FROM {$GLOBALS['CONFIG']['db_prefix']}data WHERE id = '{$_REQUEST['id']}' AND status = '{$_SESSION['uid']}'";
    $result = mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}. " . mysql_error());
    // in case script is directly accessed, query above will return 0 rows
开发者ID:tejdeeps,项目名称:tejcs.com,代码行数:31,代码来源:check-in.php


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