示例#1
0
function requestURI($full = 0)
{
    //$s = $full?((stripos($_SERVER['SERVER_PROTOCOL'],"https") === false)?"http://":"https://").$_SERVER['HTTP_HOST']:"";
    $s = $full ? Header::makeHTTPHost() : "";
    $uri = $_SERVER['REQUEST_URI'];
    if (strpos($uri, "javascript:") !== false) {
        $uri = str_replace("javascript:", "", $uri);
    }
    return $s . $uri;
}
示例#2
0
文件: Header.php 项目: point/cassea
    /** {{{ redirect
     * Переадресация клиента
     *
     * RFC 2616, 10.3.4
     * RFC 2616, 10.3.3
     *
     * @param    string $url    Адрес пересылки
     * @return   void
     */
    static function redirect($url, $code = 302)
    {
        header($_SERVER['SERVER_PROTOCOL'] . ' ' . $code . ' ' . self::$statusText[$code]);
        if (!strpos($url, '://')) {
            $url = Header::makeHTTPHost() . $url;
        }
        header('Location: ' . $url);
        echo <<<GO
            <html><head><title>Redirect</title></head><body><p><p> 
            HTTP redirect (status code: {$code} ).<br> 
            Follow the <a href="{$url}">"White Rabbit"</a>. 
            </body></html> 
GO;
        die;
    }
示例#3
0
 /**
  * Redirects to specified location or page.
  *
  * @param string location, ie "/blog/2.html" or page "2.html". In the last case, all 
  * current parameters will be saved and only page will be changed.
  * return null
  */
 protected function gotoLocation($loc)
 {
     if (!isset($loc)) {
         exit;
     }
     if (($pos = strpos($loc, "/")) === false) {
         $loc = $this->makeURL($loc);
     } elseif ($pos == 0) {
         $loc = Header::makeHTTPHost() . $loc;
     }
     Header::redirect($loc, Header::SEE_OTHER);
 }