本文整理汇总了PHP中cookie_check函数的典型用法代码示例。如果您正苦于以下问题:PHP cookie_check函数的具体用法?PHP cookie_check怎么用?PHP cookie_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cookie_check函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect
/**
* Redirect URL
*
* @since 3.0
* @author schlex
*
* @param string $url
* @param bool ajax force redirects if ajax
*/
function redirect($url, $ajax = false)
{
global $i18n;
$url = var_out($url, 'url');
// filter url here since it can come from alot of places, specifically redirectto user input
// handle expired sessions for ajax requests
if (requestIsAjax()) {
if (!cookie_check()) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: FormBased');
// @note this is not a security function for ajax, just a session timeout handler
die;
} else {
if ($ajax) {
header('HTTP/1.1 302 Redirect');
echo $url;
// header('Location: '.$url);
// @note this is not a security function for ajax, just a session timeout handler
die;
}
}
}
if (function_exists('exec_action')) {
exec_action('redirect');
}
// @hook redirect a redirect is occuring
$debugredirect = getDef('GSDEBUGREDIRECTS', true);
if (!headers_sent($filename, $linenum) && !$debugredirect) {
header('Location: ' . $url);
} else {
// @todo not sure this ever gets used or headers_sent is reliable ( turn output buffering off to test )
echo "<html><head><title>" . i18n_r('REDIRECT') . "</title></head><body>";
if (!isDebug()) {
echo '<script type="text/javascript">';
echo 'window.location.href="' . $url . '";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url=' . $url . '" />';
echo '</noscript>';
}
if (headers_sent()) {
echo i18n_r('ERROR') . ": Headers already sent in " . $filename . " on line " . $linenum . "<br/><br/>\n\n";
}
printf(i18n_r('REDIRECT_MSG'), $url);
if (!isAuthPage()) {
if (isDebug()) {
debugLog(debug_backtrace());
outputDebugLog();
}
}
echo "</body></html>";
}
exit;
}
示例2: cl
<?php
/**
* Navigation Include Template
*
* @package GetSimple
*/
$debugInfoUrl = 'http://get-simple.info/docs/debugging';
if (cookie_check()) {
echo '<ul id="pill"><li class="leftnav"><a href="logout.php" accesskey="' . find_accesskey(i18n_r('TAB_LOGOUT')) . '" >' . i18n_r('TAB_LOGOUT') . '</a></li>';
if (isDebug()) {
echo '<li class="debug"><a href="' . $debugInfoUrl . '" target="_blank">' . i18n_r('DEBUG_MODE') . '</a></li>';
}
echo '<li class="rightnav" ><a href="settings.php#profile">' . i18n_r('WELCOME') . ' <strong>' . $USR . '</strong>!</a></li></ul>';
}
//determine page type if plugin is being shown
if (get_filename_id() == 'load') {
$plugin_class = $plugin_info[$plugin_id]['page_type'];
} else {
$plugin_class = '';
}
?>
<h1 id="sitename"><a href="<?php
echo $SITEURL;
?>
" target="_blank" ><?php
echo cl($SITENAME);
?>
</a></h1>
<ul class="nav <?php
echo $plugin_class;
示例3: annoucements
<?php
require_once 'config.inc.php';
#-------------------------------------------------------------------------------
# Returns latest list of annoucements (used by AJAX)
session_start();
cookie_check();
# Setup the database connection
$db =& DB::connect($cfg["db"]);
if (PEAR::isError($db)) {
error($db->toString());
}
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$ret = "";
if (auth_logged_in()) {
$res =& $db->query($cfg['sql']['bulletin_by_level'] . ' LIMIT 0, 10', 0);
if (PEAR::isError($res)) {
error($res->toString());
}
while ($res->fetchInto($row)) {
$row['message'] = preg_replace("/<br\\s*\\/?>/", '', $row['message']);
$row['message'] = substr($row['message'], 0, min(strlen($row['message']), 80));
$ret .= "<div><a href=\"index.php?view=bulletin&task=announce\">{$row['subject']}:</a> {$row['message']}</div>";
}
$res->free();
} else {
$res =& db_query('relevant_contests_list');
if ($res->numRows() == 0) {
$ret .= "No contests scheduled.";
}
while ($res->fetchInto($row)) {
示例4: get_cookie
/**
* Get Cookie
*
* @since 1.0
* @global $_COOKIE
* @uses cookie_check
*
* @return bool
*/
function get_cookie($cookie_name)
{
if (cookie_check($cookie_name) === true) {
return $_COOKIE[$cookie_name];
}
}
示例5: redirect
/**
* Redirect URL
*
* @since 3.0
* @author schlex
*
* @param string $url
*/
function redirect($url)
{
global $i18n;
// handle expired sessions for ajax requests
if (requestIsAjax() && !cookie_check()) {
header('HTTP/1.1 401 Unauthorized', true, 401);
header('WWW-Authenticate: FormBased');
die;
}
if (!headers_sent($filename, $linenum)) {
header('Location: ' . $url);
} else {
echo "<html><head><title>" . i18n_r('REDIRECT') . "</title></head><body>";
if (!isDebug()) {
echo '<script type="text/javascript">';
echo 'window.location.href="' . $url . '";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url=' . $url . '" />';
echo '</noscript>';
}
echo i18n_r('ERROR') . ": Headers already sent in " . $filename . " on line " . $linenum . "\n";
printf(i18n_r('REDIRECT_MSG'), $url);
echo "</body></html>";
}
exit;
}
示例6: redirect
/**
* Redirect URL
*
* @since 3.0
* @author schlex
*
* @param string $url
*/
function redirect($url)
{
global $i18n;
// handle expired sessions for ajax requests
if (requestIsAjax() && !cookie_check()) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: FormBased');
// @note this is not a security function for ajax, just a handler
die;
}
if (function_exists('exec_action')) {
exec_action('redirect');
}
if (!headers_sent($filename, $linenum)) {
header('Location: ' . $url);
} else {
// @todo not sure this ever gets used or headers_sent is reliable ( turn output buffering off to test )
echo "<html><head><title>" . i18n_r('REDIRECT') . "</title></head><body>";
if (!isDebug()) {
echo '<script type="text/javascript">';
echo 'window.location.href="' . $url . '";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url=' . $url . '" />';
echo '</noscript>';
}
echo i18n_r('ERROR') . ": Headers already sent in " . $filename . " on line " . $linenum . "<br/><br/>\n\n";
printf(i18n_r('REDIRECT_MSG'), $url);
if (!isAuthPage()) {
if (isDebug()) {
global $GS_debug;
echo '<h2>' . i18n_r('DEBUG_CONSOLE') . '</h2><div id="gsdebug">';
echo '<pre>';
foreach ($GS_debug as $log) {
print $log . '<br/>';
}
echo '</pre>';
echo '</div>';
}
}
echo "</body></html>";
}
exit;
}
示例7: get_cookie
/**
* Get Cookie Value
*
* @uses cookie_check
* @param string $name
* @return string
*/
function get_cookie($name)
{
if (cookie_check($name) == TRUE) {
return $_COOKIE[$name];
}
}
示例8: msgError
if (!$status) {
$error .= msgError('Unable to rename cp_settings.xml to _legacy_cp_settings.xml');
} else {
$message .= msgOK('Renamed cp_settings.xml to _legacy_cp_settings.xml');
}
}
/* end update */
}
// redirect to health check or login and show updated notice
$redirect = cookie_check() ? "health-check.php?updated=1" : "index.php?updated=1";
// If no errors or messages, then we did nothing, just continue automatically
if (!isset($error) && !isset($message)) {
redirect($redirect);
}
// we already showed a notice, pass updated so it gets deleted, no indication,
$redirect = cookie_check() ? "health-check.php?updated=2" : "index.php?updated=2";
// show errors or messages
if (isset($error)) {
$message .= i18n_r('ER_REQ_PROC_FAIL');
} else {
$message .= "<p><div class=\"notify notify_ok\">" . i18n_r('SITE_UPDATED') . "</div></p>";
}
$pagetitle = $site_full_name . ' · ' . i18n_r('SYSTEM_UPDATE');
get_template('header');
?>
<h1><?php
echo $site_full_name;
?>
</h1>
</div>
示例9: start
function start()
{
session_start();
require "check.php";
cookie_check();
}
示例10: cookie_check
<?php
/**
* Basic File Browser for I18N Custom Fields
*
* Displays and selects file link to insert
*/
include '../../../admin/inc/common.php';
$loggedin = cookie_check();
if (!$loggedin) {
die;
}
if (isset($_GET['path'])) {
$subPath = preg_replace('/\\.+\\//', '', $_GET['path']);
$path = "../../../data/uploads/items/" . $subPath;
} else {
$subPath = "";
$path = "../../../data/uploads/items/";
}
$path = tsl($path);
// check if host uses Linux (used for displaying permissions
$isUnixHost = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? false : true;
$path_parts = pathinfo($_SERVER['PHP_SELF']);
$dir = str_replace("/plugins/i18n_customfields/browser", "", $path_parts['dirname']);
$fullPath = htmlentities("http://" . $_SERVER['SERVER_NAME'] . ($dir == '/' ? "" : $dir) . "/data/uploads/items/", ENT_QUOTES);
$sitepath = htmlentities("http://" . $_SERVER['SERVER_NAME'] . ($dir == '/' ? "" : $dir) . "/", ENT_QUOTES);
$func = @$_GET['func'];
$type = @$_GET['type'];
if (!defined('IN_GS')) {
die('you cannot load this page directly.');
}
示例11: redirect
<?php
/**
* Safemode Loader
* enabled safemode automatically, if authenticated
*
* @package GetSimple
* @subpackage Basic-Functions
*/
// Include common.php
$load['plugin'] = false;
include 'inc/common.php';
if (!cookie_check()) {
redirect('index.php?redirect=safemode.php');
}
enableSafeMode();
gotoDefaultPage();
/* ?> */