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


PHP redirect_header函数代码示例

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


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

示例1: get_event

function get_event()
{
    global $xoopsDB, $xoopsUser;
    $andWebID = empty($_REQUEST['WebID']) ? "" : "and `WebID`='{$_REQUEST['WebID']}'";
    $start = date("Y-m-d", $_REQUEST['start'] / 1000);
    $andEnd = "";
    if ($_REQUEST['end']) {
        $end = date("Y-m-d", $_REQUEST['end'] / 1000);
        $andEnd = "and toCal <= '{$end}'";
    }
    $andNewsKind = empty($_REQUEST['NewsKind']) ? "" : "and NewsKind='{$_REQUEST['NewsKind']}'";
    $sql = "select * from " . $xoopsDB->prefix("tad_web_news") . " where toCal >= '{$start}' {$andEnd} {$andWebID} {$andNewsKind} order by toCal";
    //$sql = "select * from ".$xoopsDB->prefix("tad_web_news")." where 1 $andWebID $andNewsKind order by toCal";
    //die($sql);
    $result = $xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error());
    $i = 0;
    while ($all = $xoopsDB->fetchArray($result)) {
        //以下會產生這些變數: $out_sn , $inspector_name , $out_date , $location , $job , $job_content
        foreach ($all as $k => $v) {
            ${$k} = $v;
        }
        $toCal = userTimeToServerTime(strtotime($toCal));
        $myEvents[$i]['id'] = $NewsID;
        $myEvents[$i]['title'] = $NewsTitle;
        $myEvents[$i]['rel'] = XOOPS_URL . "/modules/tad_web/{$NewsKind}.php?WebID={$WebID}&NewsID={$NewsID}";
        $myEvents[$i]['start'] = $toCal;
        $myEvents[$i]['allDay'] = true;
        $myEvents[$i]['className'] = "fc-event";
        $i++;
    }
    return json_encode($myEvents);
}
开发者ID:prolin99,项目名称:tad_web,代码行数:32,代码来源:get_event.php

示例2: list_tad_gallery_cate_tree

function list_tad_gallery_cate_tree($def_csn = "")
{
    global $xoopsDB, $xoopsTpl;
    $tadgallery = new tadgallery();
    $cate_count = $tadgallery->get_tad_gallery_cate_count();
    $path = get_tadgallery_cate_path($def_csn);
    $path_arr = array_keys($path);
    $sql = "select csn,of_csn,title from " . $xoopsDB->prefix("tad_gallery_cate") . " order by sort";
    $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error());
    while (list($csn, $of_csn, $title) = $xoopsDB->fetchRow($result)) {
        $font_style = $def_csn == $csn ? ", font:{'background-color':'yellow', 'color':'black'}" : '';
        $open = in_array($csn, $path_arr) ? 'true' : 'false';
        $display_counter = empty($cate_count[$csn]['file']) ? "" : " ({$cate_count[$csn]['file']})";
        $data[] = "{ id:{$csn}, pId:{$of_csn}, name:'{$title}{$display_counter}', url:'cooliris.php?csn={$csn}', open: {$open} ,target:'_self' {$font_style}}";
    }
    $json = implode(",\n", $data);
    if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/ztree.php")) {
        redirect_header("index.php", 3, _MA_NEED_TADTOOLS);
    }
    include_once XOOPS_ROOT_PATH . "/modules/tadtools/ztree.php";
    $ztree = new ztree("album_tree", $json, '', '', "of_csn", "csn");
    $ztree_code = $ztree->render();
    $xoopsTpl->assign('ztree_code', $ztree_code);
    return $data;
}
开发者ID:geek01,项目名称:tadgallery,代码行数:25,代码来源:cooliris.php

示例3: processPreview

 function processPreview($request)
 {
     // Ticket Check
     if (!$GLOBALS['xoopsGTicket']->check(true, 'pico')) {
         redirect_header(XOOPS_URL . '/', 3, $GLOBALS['xoopsGTicket']->getErrors());
     }
     // initialize
     $cat_data = $this->currentCategoryObj->getData();
     $myts =& PicoTextSanitizer::getInstance();
     // assigning other than preview/request
     // parent::execute( $request ) ;
     // permission check (can_edit) done
     // request
     $request = pico_get_requests4content($this->mydirname, $errors = array(), $cat_data['post_auto_approved'], $cat_data['isadminormod'], $this->assign['content']['id']);
     $request['body_raw'] = $request['body'];
     $request['subject_raw'] = $request['subject'];
     $request4assign = array_map('htmlspecialchars_ent', $request);
     $this->assign['request'] = $request4assign;
     // override content data for edit
     $this->assign['content'] = $request4assign + $this->assign['content'];
     $this->assign['content']['filter_infos'] = pico_main_get_filter_infos($request['filters'], $cat_data['isadminormod']);
     $this->assign['content']['body_raw'] = $request['body'];
     $this->assign['content']['extra_fields'] = $request['extra_fields'];
     $this->assign['content']['ef'] = pico_common_unserialize($request['extra_fields']);
     // temporary $contentObj
     $tmpContentObj = new PicoContent($this->mydirname, 0, $this->currentCategoryObj, true);
     // preview
     $this->assign['preview'] = array('errors' => $errors, 'htmlheader' => $request['htmlheader'], 'subject' => $myts->makeTboxData4Show($request['subject'], 1, 1), 'body' => $tmpContentObj->filterBody($this->assign['content']));
 }
开发者ID:nouphet,项目名称:rata,代码行数:29,代码来源:PicoControllerPreviewContent.class.php

示例4: _registerAction

 protected function _registerAction()
 {
     $this->form->fetchInput()->validate();
     if ($this->form->hasError() === true) {
         return;
     }
     $memberHandler =& xoops_gethandler('member');
     $newUser =& $memberHandler->createUser();
     $this->_update($newUser);
     try {
         $this->root->cms->database()->queryF('BEGIN');
         if ($memberHandler->insertUser($newUser) == false) {
             throw new Exception(t('Database error 111'));
         }
         if ($memberHandler->addUserToGroup(XOOPS_GROUP_USERS, $newUser->get('uid')) == false) {
             throw new Exception(t('Database error 222'));
         }
         $providerUserLinkHandler = $this->root->getModelHandler('ProviderUserLink', 'social_media');
         $result = $providerUserLinkHandler->addProviderUserLink($_SESSION['socialMediaType'], $_SESSION['socialMediaId'], $newUser->get('uid'));
         if ($result == false) {
             throw new Exception(t('Database error 333'));
         }
         $this->root->cms->database()->queryF('COMMIT');
         unset($_SESSION['socialMediaType'], $_SESSION['socialMediaId']);
         $this->_registerSession($newUser);
         redirect_header(XOOPS_URL, 1, t('Thank you for your registeration. You now logged in.'));
     } catch (Exception $e) {
         $this->form->addError($e->getMessage());
         $this->root->cms->database()->queryF('ROLLBACK');
     }
 }
开发者ID:nouphet,项目名称:xoops-tpSocialMedia,代码行数:31,代码来源:ProviderUserLinkAdd.php

示例5: show_rss_content

function show_rss_content()
{
    global $xoopsConfig;
    include_once $GLOBALS['xoops']->path('class/template.php');
    $tpl = new XoopsTpl();
    $module = rmc_server_var($_GET, 'mod', '');
    if ($module == '') {
        redirect_header('backend.php', 1, __('Choose an option to see its feed', 'rmcommon'));
        die;
    }
    if (!file_exists(XOOPS_ROOT_PATH . '/modules/' . $module . '/rss.php')) {
        redirect_header('backend.php', 1, __('This module does not support rss feeds', 'rmcommon'));
        die;
    }
    $GLOBALS['xoopsLogger']->activated = false;
    if (function_exists('mb_http_output')) {
        mb_http_output('pass');
    }
    header('Content-Type:text/xml; charset=utf-8');
    include XOOPS_ROOT_PATH . '/modules/' . $module . '/rss.php';
    if (!isset($rss_channel['image'])) {
        $rmc_config = RMFunctions::configs();
        $rss_channel['image']['url'] = $rmc_config['rssimage'];
        $dimention = getimagesize(XOOPS_ROOT_PATH . '/images/logo.png');
        $rss_channel['image']['width'] = $dimention[0] > 144 ? 144 : $dimention[0];
        $rss_channel['image']['height'] = $dimention[1] > 400 ? 400 : $dimention[1];
    }
    include RMTemplate::get()->get_template('rmc_rss.php', 'module', 'rmcommon');
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:29,代码来源:rss.php

示例6: xoonips_group_error

/**
 * show error
 *
 * @param string $reason 'select', 'insert', 'delete',
 *                       'lock_edit', 'lock_delete'
 */
function xoonips_group_error($url, $reason)
{
    $messages = array('select' => _MD_XOONIPS_ERROR_GROUP_SELECT, 'insert' => _MD_XOONIPS_ERROR_GROUP_INSERT, 'update' => _MD_XOONIPS_ERROR_GROUP_UPDATE, 'delete' => _MD_XOONIPS_ERROR_GROUP_DELETE, 'lock_edit' => sprintf(_MD_XOONIPS_ERROR_CANNOT_EDIT_LOCKED_GROUP, _MD_XOONIPS_LOCK_TYPE_STRING_CERTIFY_REQUEST), 'lock_delete' => sprintf(_MD_XOONIPS_ERROR_CANNOT_DELETE_LOCKED_GROUP, _MD_XOONIPS_LOCK_TYPE_STRING_CERTIFY_REQUEST));
    $msg = isset($messages[$reason]) ? $messages[$reason] : 'fatal error';
    redirect_header($url, 3, $msg);
    exit;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:13,代码来源:group.inc.php

示例7: redirect

 function redirect($message, $toFrompage = false)
 {
     if ($toFrompage) {
         $url = XOOPS_URL . '/';
         /* @var $cookie Openid_Context */
         $cookie =& OpenID_Utils::load('context');
         $cookie->accept('openid_frompage', 'string', 'cookie');
         if ($frompage = $cookie->get('openid_frompage')) {
             $parsed = parse_url(XOOPS_URL);
             $url = isset($parsed['scheme']) ? $parsed['scheme'] . '://' : 'http://';
             if (isset($parsed['host'])) {
                 $url .= $parsed['host'];
                 if (isset($parsed['port'])) {
                     $url .= ':' . $parsed['port'];
                 }
             } else {
                 $url .= xoops_getenv('HTTP_HOST');
             }
             $url .= trim($frompage);
         }
     } else {
         $url = XOOPS_URL . '/';
     }
     unset($_SESSION['openid_response']);
     setcookie('openid_frompage', '', time() - 3600);
     redirect_header($url, 2, $message);
 }
开发者ID:nouphet,项目名称:rata,代码行数:27,代码来源:utils.php

示例8: editcat

function editcat($catid = '')
{
    $name = '';
    $description = '';
    global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify;
    include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
    if ($modify) {
        $result = $xoopsDB->query("SELECT name, description FROM " . $xoopsDB->prefix("faqcategories") . " WHERE catID = '{$catid}'");
        list($name, $description) = mysql_fetch_row($result);
        if (mysql_num_rows($result) == 0) {
            redirect_header("index.php", 1, _AM_NOCATTOEDIT);
            exit;
        }
        $sform = new XoopsThemeForm(_AM_MODIFYCAT, "op", xoops_getenv('PHP_SELF'));
    } else {
        $sform = new XoopsThemeForm(_AM_ADDCAT, "op", xoops_getenv('PHP_SELF'));
    }
    $sform->addElement(new XoopsFormText(_AM_CATNAME, 'name', 50, 80, $name), true);
    $sform->addElement(new XoopsFormDhtmlTextArea(_AM_CATDESCRIPT, 'description', $description, 15, 60));
    $sform->addElement(new XoopsFormHidden('catid', $catid));
    $sform->addElement(new XoopsFormHidden('modify', $modify));
    $button_tray = new XoopsFormElementTray('', '');
    $hidden = new XoopsFormHidden('op', 'addcat');
    $button_tray->addElement($hidden);
    if ($modify == '0') {
        $button_tray->addElement(new XoopsFormButton('', 'update', _AM_CREATE, 'submit'));
    } else {
        $button_tray->addElement(new XoopsFormButton('', 'update', _AM_MODIFY, 'submit'));
    }
    $sform->addElement($button_tray);
    $sform->display();
    unset($hidden);
}
开发者ID:amjadtbssm,项目名称:website,代码行数:33,代码来源:category.php

示例9: view_pic_exif

function view_pic_exif($sn = "")
{
    global $xoopsDB, $xoopsModule, $xoopsModuleConfig;
    $sql = "select exif from " . $xoopsDB->prefix("tad_gallery") . " where sn='{$sn}'";
    $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error());
    list($exif) = $xoopsDB->fetchRow($result);
    $info = explode("||", $exif);
    foreach ($info as $v) {
        $exif_arr = explode("=", $v);
        $exif_arr[1] = str_replace("&#65533;", "", $exif_arr[1]);
        $bb = "\$aa{$exif_arr[0]}=\"{$exif_arr[1]}\";";
        if (empty($exif_arr[0])) {
            continue;
        }
        @eval($bb);
    }
    $exif_all = $exif_data = "";
    foreach ($aa as $k => $v) {
        $exif_data = "";
        foreach ($v as $kk => $vv) {
            $exif_data .= get_exif_info($kk, $vv);
        }
        if (!empty($exif_data)) {
            $exif_all .= $exif_data;
        }
    }
    return "<table style='width:auto;' class='line'>{$exif_all}</table>";
}
开发者ID:geek01,项目名称:tadgallery,代码行数:28,代码来源:exif.php

示例10: redirect_header

 function &execute(&$controller, &$request, &$user)
 {
     redirect_header("index.php", 1, $request->getAttribute('success_message'));
     $renderer = new mojaLE_NoneRenderer($controller, $request, $user);
     $renderer->setTemplate('');
     return $renderer;
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:7,代码来源:editques_success.class.php

示例11: dispatch

function dispatch()
{
	global $xoopsUser;
	
	if($this->isGuest()){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	$own_uid = $xoopsUser->getVar('uid');
	
	$limit = 30;
	$start = $this->getIntRequest('s', XSNS_REQUEST_GET);
	if(!isset($start) || $start<0){
		$start = 0;
	}
	
	$user_handler =& XsnsUserHandler::getInstance();
	$user =& $user_handler->get($own_uid);
	if(!is_object($user) || $user->getVar('level') < 1){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	$blog_list =& $user->getFriendBlogList($limit, $start, &$blog_count);
	
	$pager = $this->getPageSelector(XSNS_URL_MYPAGE.'&'.XSNS_ACTION_ARG.'=blog_list', 
						$start, $limit, count($blog_list), $blog_count);
	
	$this->context->setAttribute('user_menu', $user->getMypageMenu());
	$this->context->setAttribute('blog_list', $blog_list);
	$this->context->setAttribute('pager', $pager);
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:30,代码来源:blog_listAction.php

示例12: go_update2

function go_update2()
{
    global $xoopsDB;
    $sql = "ALTER TABLE " . $xoopsDB->prefix("jill_booking_item") . " CHANGE `jbi_approval` `jbi_approval` varchar(255) COLLATE 'utf8_general_ci' NOT NULL COMMENT '審核人員' AFTER `jbi_enable` ";
    $xoopsDB->queryF($sql) or redirect_header(XOOPS_URL, 3, mysql_error());
    return true;
}
开发者ID:mambax7,项目名称:jill_booking-1,代码行数:7,代码来源:onUpdate.php

示例13: OpenID_Library

 /**
  * constructor
  */
 function OpenID_Library()
 {
     if (!@$GLOBALS['xoopsModuleConfig']['openid_rand_souce']) {
         define('Auth_OpenID_RAND_SOURCE', null);
     } else {
         if (!@is_readable($GLOBALS['xoopsModuleConfig']['openid_rand_souce'])) {
             redirect_header(XOOPS_URL, 2, 'Please set rand_source on admin panel');
         } else {
             define('Auth_OpenID_RAND_SOURCE', $GLOBALS['xoopsModuleConfig']['openid_rand_souce']);
         }
     }
     if (@$GLOBALS['xoopsModuleConfig']['curl_cainfo_file']) {
         $cainfo = str_replace('XOOPS_ROOT_PATH', XOOPS_ROOT_PATH, $GLOBALS['xoopsModuleConfig']['curl_cainfo_file']);
         define('Auth_OpenID_CURLOPT_CAINFO_FILE', $cainfo);
     }
     if (version_compare(PHP_VERSION, '5.0.0', '>=')) {
         $path_extra = XOOPS_ROOT_PATH . '/modules/openid/class/php5-openid';
     } else {
         $path_extra = XOOPS_ROOT_PATH . '/modules/openid/class/php-openid';
     }
     $path = ini_get('include_path');
     $path = $path_extra . PATH_SEPARATOR . $path;
     ini_set('include_path', $path);
     $this->doIncludes();
     // @todo Set on module config
     $this->sregFields = array('nickname', 'fullname', 'email', 'timezone');
     $this->pape_policy_uris = array(PAPE_AUTH_MULTI_FACTOR_PHYSICAL, PAPE_AUTH_MULTI_FACTOR, PAPE_AUTH_PHISHING_RESISTANT);
 }
开发者ID:nouphet,项目名称:rata,代码行数:31,代码来源:library.php

示例14: dispatch

function dispatch()
{
	global $xoopsUser;
	
	if($this->isGuest() || !$this->validateToken('CONFIG_EDIT')){
		redirect_header(XOOPS_URL, 2, _NOPERM);
	}
	
	$own_uid = $xoopsUser->getVar('uid');
	
	$config_arr = $this->getConfigArray();
	if(!is_array($config_arr)){
		redirect_header(XSNS_URL_MYPAGE, 2, _MD_XSNS_CONFIG_CHANGE_NG);
	}
	
	$module_config_handler =& XsnsModuleConfigHandler::getInstance();
	$module_config =& $module_config_handler->getOne($own_uid);
	if(!is_object($module_config)){
		$module_config =& $module_config_handler->create();
		$module_config->setVar('uid', $own_uid);
	}
	$module_config->setVar('config_values', $config_arr);
	
	if($module_config_handler->insert($module_config)){
		redirect_header(XSNS_URL_MYPAGE_NEWS.'&uid='.$own_uid, 2, _MD_XSNS_CONFIG_CHANGE_OK);
	}
	redirect_header(XSNS_URL_MYPAGE, 2, _MD_XSNS_CONFIG_CHANGE_NG);
}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:28,代码来源:config_edit_execAction.php

示例15: sendComment

function sendComment()
{
    global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $mc, $xoopsConfig;
    $util =& RMUtils::getInstance();
    if (!$util->validateToken()) {
        redirect_header('comment.php', 2, _MS_TC_ERRID);
        die;
    }
    foreach ($_POST as $k => $v) {
        ${$k} = $v;
    }
    if ($name == '' || $email == '' || $comment == '') {
        redirect_header('comment.php', 2, _MS_TC_ERRFIELDS);
        die;
    }
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $xoopsMailer->setTemplate('mail.tpl');
    $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
    $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
    $xoopsMailer->assign('SITEURL', XOOPS_URL . "/");
    $xoopsMailer->assign('NAME', $name);
    $xoopsMailer->assign('EMAIL', $email);
    $xoopsMailer->assign('COMMENTS', $comment);
    $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH . "/modules/team/language/" . $xoopsConfig['language'] . "/");
    $xoopsMailer->setFromEmail($email);
    $xoopsMailer->setFromName($name);
    $xoopsMailer->setSubject(sprintf(_MS_TC_COMFROM, $xoopsConfig['sitename'] . ": " . $xoopsModule->name()));
    $xoopsMailer->setToEmails($xoopsModuleConfig['email']);
    if (!$xoopsMailer->send(true)) {
        redirect_header('comment.php', 2, $xoopsMailer->getErrors());
    } else {
        redirect_header('./', 1, _MS_TC_COMTHX);
    }
}
开发者ID:laiello,项目名称:bitcero-modules,代码行数:35,代码来源:comment.php


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