Re: Re: header

From: Date: Wed, 17 Sep 2008 07:19:22 +0000
Subject: Re: Re: header
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.general 
Request: Send a blank email to php-general+get-280340@lists.php.net to get a copy of this message
On Tue, Sep 16, 2008 at 11:40 PM, Micah Gersten <micah@onshore.com> 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'];

« previous php.general (#280340) next »