• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP string_prepare_header函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: print_header_redirect

function print_header_redirect($p_url, $p_die = true, $p_sanitize = false, $p_absolute = false)
{
    $t_use_iis = config_get('use_iis');
    if (ON == config_get_global('stop_on_errors') && error_handled()) {
        return false;
    }
    # validate the url as part of this site before continuing
    if ($p_absolute) {
        if ($p_sanitize) {
            $t_url = string_sanitize_url($p_url);
        } else {
            $t_url = $p_url;
        }
    } else {
        if ($p_sanitize) {
            $t_url = string_sanitize_url($p_url, true);
        } else {
            $t_url = config_get('path') . $p_url;
        }
    }
    $t_url = string_prepare_header($t_url);
    # don't send more headers if they have already been sent (guideweb)
    if (!headers_sent()) {
        header('Content-Type: text/html; charset=utf-8');
        if (ON == $t_use_iis) {
            header("Refresh: 0;url={$t_url}");
        } else {
            header("Location: {$t_url}");
        }
    } else {
        trigger_error(ERROR_PAGE_REDIRECTION, ERROR);
        return false;
    }
    if ($p_die) {
        die;
        # additional output can cause problems so let's just stop output here
    }
    return true;
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:39,代码来源:print_api.php


示例2: require_api

require_api('config_api.php');
require_api('constant_inc.php');
require_api('current_user_api.php');
require_api('filter_api.php');
require_api('gpc_api.php');
require_api('helper_api.php');
require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('string_api.php');
require_api('utility_api.php');
$f_project_id = gpc_get_string('project_id');
$f_make_default = gpc_get_bool('make_default');
$f_ref = gpc_get_string('ref', '');
$c_ref = string_prepare_header($f_ref);
$t_project = explode(';', $f_project_id);
$t_top = $t_project[0];
$t_bottom = $t_project[count($t_project) - 1];
if (ALL_PROJECTS != $t_bottom) {
    project_ensure_exists($t_bottom);
}
# Set default project
if ($f_make_default) {
    current_user_set_default_project($t_top);
}
helper_set_current_project($f_project_id);
# redirect to 'same page' when switching projects.
# for proxies that clear out HTTP_REFERER
if (!is_blank($c_ref)) {
    $t_redirect_url = $c_ref;
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:31,代码来源:set_project.php


示例3: gpc_get_string

# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with MantisBT.  If not, see <http://www.gnu.org/licenses/>.
/**
 * Check to see if cookies are working
 *
 * @package MantisBT
 * @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito - [email protected]
 * @copyright Copyright (C) 2002 - 2014  MantisBT Team - [email protected]
 * @link http://www.mantisbt.org
 */
/**
 * MantisBT Core API's
 */
require_once 'core.php';
if (auth_is_user_authenticated()) {
    $f_return = gpc_get_string('return');
    $c_return = string_prepare_header($f_return);
    # If this is the first login for an instance, then redirect to create project page.
    # Use lack of projects as a hint for such scenario.
    if (is_blank($f_return) || $f_return == 'index.php') {
        if (current_user_is_administrator() && project_table_empty()) {
            $c_return = 'manage_proj_create_page.php';
        }
    }
    $t_redirect_url = $c_return;
} else {
    $t_redirect_url = 'login_page.php?cookie_error=1';
}
print_header_redirect($t_redirect_url, true, true);
开发者ID:Tarendai,项目名称:spring-website,代码行数:31,代码来源:login_cookie_test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP string_process_bugnote_link函数代码示例发布时间:2022-05-23
下一篇:
PHP string_normalize函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap