當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。