本文整理汇总了PHP中dheader函数的典型用法代码示例。如果您正苦于以下问题:PHP dheader函数的具体用法?PHP dheader怎么用?PHP dheader使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dheader函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: global_kkvip
function global_kkvip()
{
global $_G, $vip;
if ($_GET['op'] == 'verify' && in_array($_GET['vid'], array('vip', 'no_vip'))) {
dheader('Location: vip.php');
}
if ($_GET['op'] == 'verify' && in_array($_GET['vid'], array('year_vip', 'no_year_vip'))) {
dheader('Location: vip.php?do=year');
}
if (!$_G['uid'] || $_G['vip']) {
return;
}
loadcache('plugin');
include_once libfile('class/vip');
$vip = $vip ? $vip : new vip();
if ($vip->is_vip($_G['uid'])) {
$_G['vip']['isvip'] = false;
return;
}
$_G['vip'] = $vip->getvipinfo($_G['uid']);
$_G['vip']['isvip'] = true;
if ($vip->vars['vip_noad']) {
loadcache('advs');
unset($_G['cache']['advs']);
}
return;
}
示例2: common
function common()
{
global $_G;
if (!defined('IN_DISCUZ') || empty($_GET['aid']) || empty($_GET['size']) || empty($_GET['key'])) {
header('location: ' . $_G['siteurl'] . 'static/image/common/none.gif');
exit;
}
$allowsize = array('960x960', '268x380', '266x698', '2000x2000');
if (!in_array($_GET['size'], $allowsize)) {
header('location: ' . $_G['siteurl'] . 'static/image/common/none.gif');
exit;
}
$nocache = !empty($_GET['nocache']) ? 1 : 0;
$daid = intval($_GET['aid']);
$type = !empty($_GET['type']) ? $_GET['type'] : 'fixwr';
list($w, $h) = explode('x', $_GET['size']);
$dw = intval($w);
$dh = intval($h);
$thumbfile = 'image/' . $daid . '_' . $dw . '_' . $dh . '.jpg';
$parse = parse_url($_G['setting']['attachurl']);
$attachurl = !isset($parse['host']) ? $_G['siteurl'] . $_G['setting']['attachurl'] : $_G['setting']['attachurl'];
if (!$nocache) {
if (file_exists($_G['setting']['attachdir'] . $thumbfile)) {
dheader('location: ' . $attachurl . $thumbfile);
}
}
define('NOROBOT', TRUE);
$id = !empty($_GET['atid']) ? $_GET['atid'] : $daid;
if (md5($id . '|' . $dw . '|' . $dh) != $_GET['key']) {
dheader('location: ' . $_G['siteurl'] . 'static/image/common/none.gif');
}
if ($attach = C::t('forum_attachment_n')->fetch('aid:' . $daid, $daid, array(1, -1))) {
if (!$dw && !$dh && $attach['tid'] != $id) {
dheader('location: ' . $_G['siteurl'] . 'static/image/common/none.gif');
}
dheader('Expires: ' . gmdate('D, d M Y H:i:s', TIMESTAMP + 3600) . ' GMT');
if ($attach['remote']) {
$filename = $_G['setting']['ftp']['attachurl'] . 'forum/' . $attach['attachment'];
} else {
$filename = $_G['setting']['attachdir'] . 'forum/' . $attach['attachment'];
}
require_once libfile('class/image');
$img = new image();
if ($img->Thumb($filename, $thumbfile, $w, $h, $type)) {
if ($nocache) {
dheader('Content-Type: image');
@readfile($_G['setting']['attachdir'] . $thumbfile);
@unlink($_G['setting']['attachdir'] . $thumbfile);
} else {
dheader('location: ' . $attachurl . $thumbfile);
}
} else {
dheader('Content-Type: image');
@readfile($filename);
}
}
exit;
}
示例3: msg
function msg($msg = errmsg, $forward = 'goback', $time = '1')
{
global $CFG;
if (!$msg && $forward && $forward != 'goback') {
dheader($forward);
}
include DT_ROOT . '/admin/template/msg.tpl.php';
exit;
}
示例4: common
function common()
{
global $_G;
if (is_numeric($_G['setting']['seccodedata']['type'])) {
if (in_array($_G['setting']['seccodedata']['type'], array(2, 3))) {
exit;
}
$seccode = make_seccode();
if (!$_G['setting']['nocacheheaders']) {
@header("Expires: -1");
@header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE);
@header("Pragma: no-cache");
}
require_once libfile('class/seccode');
$code = new seccode();
$code->code = $seccode;
$code->type = $_G['setting']['seccodedata']['type'];
$code->width = $_G['setting']['seccodedata']['width'];
$code->height = $_G['setting']['seccodedata']['height'];
$code->background = $_G['setting']['seccodedata']['background'];
$code->adulterate = $_G['setting']['seccodedata']['adulterate'];
$code->ttf = $_G['setting']['seccodedata']['ttf'];
$code->angle = $_G['setting']['seccodedata']['angle'];
$code->warping = $_G['setting']['seccodedata']['warping'];
$code->scatter = $_G['setting']['seccodedata']['scatter'];
$code->color = $_G['setting']['seccodedata']['color'];
$code->size = $_G['setting']['seccodedata']['size'];
$code->shadow = $_G['setting']['seccodedata']['shadow'];
$code->animator = 0;
$code->fontpath = DISCUZ_ROOT . './static/image/seccode/font/';
$code->datapath = DISCUZ_ROOT . './static/image/seccode/';
$code->includepath = DISCUZ_ROOT . './source/class/';
$code->display();
} else {
$etype = explode(':', $_G['setting']['seccodedata']['type']);
if (count($etype) > 1) {
$codefile = DISCUZ_ROOT . './source/plugin/' . $etype[0] . '/seccode/seccode_' . $etype[1] . '.php';
$class = $etype[1];
} else {
$codefile = libfile('seccode/' . $_G['setting']['seccodedata']['type'], 'class');
$class = $_G['setting']['seccodedata']['type'];
}
if (file_exists($codefile)) {
@(include_once $codefile);
$class = 'seccode_' . $class;
if (class_exists($class)) {
make_seccode();
$code = new $class();
$image = $code->image($idhash, $modid);
if ($image) {
dheader('location: ' . $image);
}
}
}
}
}
示例5: optimizer
public function optimizer()
{
$adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php';
if ($_GET['optimizefid']) {
$url = '?action=forums&operation=edit&fid=' . dintval($_GET['optimizefid']);
} else {
$url = '?action=forums';
}
dheader('Location: ' . $_G['siteurl'] . $adminfile . $url);
}
示例6: optimizer
public function optimizer()
{
$adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php';
if ($_GET['checkemail']) {
$url = '?action=setting&operation=mail';
} else {
$url = '?action=setting&operation=access';
}
dheader('Location: ' . $_G['siteurl'] . $adminfile . $url);
}
示例7: adminchecklogin
function adminchecklogin()
{
global $_ADMINUSERS;
if (empty($_ADMINUSERS['adminid'])) {
//set_cookie('_refer', rawurlencode($_SERVER['REQUEST_URI']));//设置登录成功跳转地址
dheader("login.php");
//php跳转页面
// showmsg('你未登录!请登录后操作!', "login.php",0,1);
exit;
}
}
示例8: dsu_signtz
function dsu_signtz()
{
global $_G;
if (defined('IN_MOBILE')) {
return '';
} else {
if ($_G['cache']['plugin']['dsu_paulsign']['ajax_sign']) {
return '<script type="text/javascript">showWindow(\'dsu_paulsign\', \'plugin.php?id=dsu_paulsign:sign&' . FORMHASH . '\');</script>';
} else {
dheader('Location: plugin.php?id=dsu_paulsign:sign');
}
}
}
示例9: global_footer
function global_footer()
{
global $_G;
if ($_G['mod'] == 'forumdisplay' || $_G['mod'] == 'viewthread' || $_G['mod'] == 'post' || $_G['mod'] == 'redirect') {
$fiddb = DB::fetch_first("SELECT * FROM " . DB::table('dsu_marcofidts') . " WHERE fid='" . intval($_G['fid']) . "'");
$groups = explode(",", $fiddb['groups']);
if ($_G['fid'] == $fiddb['fid'] && in_array($_G['groupid'], $groups)) {
if (!$_G['cookie']["dsu_marcofidts_{$_G[fid]}"]) {
dsetcookie('dsu_marcofidts_back', base64_encode($_SERVER['REQUEST_URI']));
dheader('Location: plugin.php?id=dsu_marcofidts&fid=' . intval($_G['fid']) . '');
}
}
}
}
示例10: common
function common()
{
global $_G, $seccodecheck, $secqaacheck, $connect_guest;
if ($_G['uid'] && $_G['member']['conisbind']) {
dheader('location: ' . $_G['siteurl'] . 'index.php');
}
$connect_guest = array();
if ($_G['connectguest'] && (submitcheck('regsubmit', 0, $seccodecheck, $secqaacheck) || submitcheck('loginsubmit', 1, $seccodestatus))) {
if (!$_GET['auth_hash']) {
$_GET['auth_hash'] = $_G['cookie']['con_auth_hash'];
}
$conopenid = authcode($_GET['auth_hash']);
$connect_guest = C::t('#qqconnect#common_connect_guest')->fetch($conopenid);
if (!$connect_guest) {
dsetcookie('con_auth_hash');
showmessage('qqconnect:connect_login_first');
}
}
}
示例11: common
public function common()
{
global $_G;
if (self::$securityStatus != TRUE) {
return false;
}
if ($_G['uid']) {
$lastCookieReportTime = $this->_decodeReportTime($_G['cookie']['security_cookiereport']);
if ($lastCookieReportTime < strtotime('today')) {
$this->_reportLoginUser(array('uid' => $_G['uid']));
}
}
if ($_G['adminid'] > 0) {
self::$isAdminGroup = 1;
}
if ($_G['setting']['connect']['allow'] && $_G['setting']['security_qqlogin_alone']) {
$_G['setting']['regstatus'] = 0;
$_G['setting']['regconnect'] = 1;
}
if ($_G['setting']['connect']['allow'] && $_G['setting']['security_safelogin'] && (!$_G['uid'] && $_G['connectguest'] || $_G['uid'] && !$_G['member']['conisbind']) && CURMODULE == 'post') {
$msg = '<p>' . lang('plugin/security', 'safelogintips') . '</p><p class="mtm"><a href="connect.php?mod=config" target="_blank"><img src="' . IMGDIR . '/qq_bind_small.gif" class="qq_bind" align="absmiddle" /></a></p>';
if ($_G['inajax']) {
if (!$_GET['ajaxtarget']) {
$_GET['handlekey'] = 'safelogin';
}
if (!$_G['uid'] && $_G['connectguest']) {
showmessage('qqconnect:connectguest_message_complete_or_bind');
} else {
showmessage($msg, 'connect.php?mod=config', array(), array('alert' => 'info', 'showdialog' => true, 'striptags' => false, 'locationtime' => 0));
}
} else {
if (!$_G['uid'] && $_G['connectguest']) {
dheader('location: ' . $_G['siteurl'] . 'member.php?mod=connect&ac=bind');
} else {
showmessage($msg, '', array(), array('alert' => 'info', 'showdialog' => true, 'msgtype' => 2, 'striptags' => false));
}
}
}
if ($_G['setting']['connect']['allow'] && $_G['setting']['security_qqlogin_alone'] && CURMODULE == 'logging' && $_GET['action'] == 'login' && submitcheck('loginsubmit', 1)) {
showmessage('security:qqloginaloneopened');
}
return true;
}
示例12: dsu_signtz
function dsu_signtz()
{
global $_G;
if (defined('IN_MOBILE')) {
return '';
} else {
if (in_array($_G['groupid'], unserialize($_G['cache']['plugin']['dsu_paulsign']['autosign_ug']))) {
$nfastreplytext = str_replace(array("\r\n", "\n", "\r"), '/hhf/', $_G['cache']['plugin']['dsu_paulsign']['fastreplytext']);
$fastreplytexts = explode("/hhf/", $nfastreplytext);
return '<script type="text/javascript">showWindow(\'dsu_paulsign\', \'plugin.php?id=dsu_paulsign:sign&operation=qiandao&formhash=' . FORMHASH . '&qdmode=2&fastreply=' . array_rand($fastreplytexts, '1') . '&qdxq=' . array_rand(unserialize($_G['setting']['paulsign_emot']), '1') . '\');</script>';
} else {
if ($_G['cache']['plugin']['dsu_paulsign']['ajax_sign']) {
return '<script type="text/javascript">showWindow(\'dsu_paulsign\', \'plugin.php?id=dsu_paulsign:sign&' . FORMHASH . '\');</script>';
} else {
dheader('Location: plugin.php?id=dsu_paulsign:sign');
}
}
}
}
示例13: actionLogout
public function actionLogout()
{
global $_G;
if (!$_G['uid']) {
dheader('location: index.php?r=site/index');
}
if ($_GET['formhash'] != $_G['formhash']) {
exit('请求来路不明');
} else {
global $_G;
require_once libfile('function/member');
$ucsynlogout = $this->setting['allowsynlogin'] ? uc_user_synlogout() : '';
clearcookies();
$_G['groupid'] = $_G['member']['groupid'] = 7;
$_G['uid'] = $_G['member']['uid'] = 0;
$_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
$_G['setting']['styleid'] = $this->setting['styleid'];
//退出登录成功
dheader('location: ' . dreferer());
}
return true;
}
示例14: define
<?php
/*
[Discuz!] (C)2001-2007 Comsenz Inc.
This is NOT a freeware, use is subject to license terms
$Id: forumdisplay.php 10115 2007-08-24 00:58:08Z cnteacher $
*/
define('CURSCRIPT', 'forumdisplay');
require_once './include/common.inc.php';
require_once DISCUZ_ROOT . './include/forum.func.php';
$discuz_action = 2;
if ($forum['redirect']) {
dheader("Location: {$forum['redirect']}");
} elseif ($forum['type'] == 'group') {
dheader("Location: {$indexname}?gid={$fid}");
} elseif (empty($forum['fid'])) {
showmessage('forum_nonexistence', NULL, 'HALTED');
}
$showoldetails = isset($showoldetails) ? $showoldetails : '';
switch ($showoldetails) {
case 'no':
dsetcookie('onlineforum', 0, 86400 * 365);
break;
case 'yes':
dsetcookie('onlineforum', 1, 86400 * 365);
break;
}
if ($forum['type'] == 'forum') {
$navigation = "» {$forum['name']}";
$navtitle = strip_tags($forum['name']);
示例15: diconv
$filename = 'favicon.ico';
} else {
$shortcut = '[InternetShortcut]
URL=' . $_G['siteurl'] . '
IconFile=' . $_G['siteurl'] . 'favicon.ico
IconIndex=1
';
$filename = $_G['setting']['bbname'] . '.url';
}
if (!strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
$filename = diconv($filename, CHARSET, 'UTF-8');
} else {
$filename = diconv($filename, CHARSET, 'GBK');
}
dheader('Content-type: application/octet-stream');
dheader('Content-Disposition: attachment; filename="' . $filename . '"');
echo $shortcut;
exit;
} elseif ($_GET['action'] == 'livelastpost') {
$fid = dintval($_GET['fid']);
$forum = C::t('forum_forumfield')->fetch($fid);
$livetid = $forum['livetid'];
$postlist = array();
if ($livetid) {
$thread = C::t('forum_thread')->fetch($livetid);
$postlist['count'] = $thread['replies'];
$postarr = C::t('forum_post')->fetch_all_by_tid('tid:' . $livetid, $livetid, true, 'DESC', 20);
ksort($postarr);
foreach ($postarr as $post) {
if ($post['first'] == 1 || getstatus($post['status'], 1)) {
continue;