zoukankan      html  css  js  c++  java
  • 自定义跳转函数

    /**
     * URL跳转
     * @param string $url 跳转地址
     * @param int $time 跳转延时(单位:秒)
     * @param string $msg 提示语
     */
    function redirect($url, $time = 0, $msg = '') {
        $url = str_replace(array("
    ", "
    "), '', $url); // 多行URL地址支持
        if (empty($msg)) {
            $msg = "系统将在 {$time}秒 之后自动跳转到 {$url} !";
        }
        if (headers_sent()) {
            $str = "<meta http-equiv='Refresh' content='{$time};URL={$url}'>";
            if ($time != 0) {
                $str .= $msg;
            }
            exit($str);
        } else {
            if (0 === $time) {
                header("Location: " . $url);
            } else {
                header("Content-type: text/html; charset=utf-8");
                header("refresh:{$time};url={$url}");
                echo($msg);
            }
            exit();
        }
    }
    /**
     * URL跳转
     * @param string $url 跳转地址
     * @param int $time 跳转延时(单位:秒)
     * @param string $msg 提示语
     */
    function redirect($url, $time = 0, $msg = '') {
    	$url = str_replace(array("
    ", "
    "), '', $url); // 多行URL地址支持
    	if (empty($msg)) {
    		$msg = "系统将在 {$time}秒 之后自动跳转到 {$url} !";
    	}
    	if (headers_sent()) {
    		$str = "<meta http-equiv='Refresh' content='{$time};URL={$url}'>";
    		if ($time != 0) {
    			$str .= $msg;
    		}
    		exit($str);
    	} else {
    		if (0 === $time) {
    			header("Location: " . $url);
    		} else {
    			header("Content-type: text/html; charset=utf-8");
    			header("refresh:{$time};url={$url}");
    			echo($msg);
    		}
    		exit();
    	}
    }
  • 相关阅读:
    SQL 窗口函数
    时间序列模型(三):指数平滑法
    时间序列模型(二):移动平均法(MA)
    时间序列模型(一):模型概述
    时间序列分析
    分类数据和顺序数据转换为标志变量
    数据标准化
    指数加权移动平均法(EWMA)
    适用于多品种情况的回归控制图
    SQL NOT NULL 约束
  • 原文地址:https://www.cnblogs.com/blueskycc/p/5363999.html
Copyright © 2011-2022 走看看