Re: Re: header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 16, 2008 at 11:40 PM, Micah Gersten <micah@xxxxxxxxxxx> wrote:
> Wouldn't it be nice if in the $_SERVER array you could get the whole URL
> now that PHP has a parse_url function?

That actually would be a nice thing to have, instead of having to
build it yourself (considering people do it a variety of ways)

Although I think this would sum it up quite briefly:

$url = 'http';
if(isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')
{ $url .= 's'; }
$url .= '//'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux