Re: "fragment" component of a URL
| From: | Daniel Convissor | Date: | Wed, 26 Jul 2000 04:25:52 +0000 |
| Subject: | Re: "fragment" component of a URL | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8203@lists.php.net to get a copy of this message | ||
Hey Angel:
Angel Fenoy wrote:
>
> Thanks Daniel. It is not what I request.
>
> Parse_url() needs a well-known string, a URL that already we know in
> the code.
>
> What I want is to know from my code if the used URL to arrive at him
> contained a "fragment"
>
> Surely I do not explain myself correctly. It is the third time that I
> make this question and I am afraid that nobody has understood to me.
You did. I just assumed you knew about the syntax of parse_url() and the
getenv() functions needed to construct the present URL. Here's what I do:
$URL = parse_url( "http://" . getenv("HTTP_HOST")
. ":" .
getenv("SERVER_PORT") . ":" . ereg_replace( "[^!#-9:;=?-Z_a-z~]",
"",
substr(getenv("REQUEST_URI"), 0, 200) ) );
That also includes steps to ensure the URI doesn't get too long and doesn't
contain any nasty characters.
Enjoy,
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
More than just answers. Solutions. (SM)
http://www.analysisandsolutions.com/
4015 7 Av #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409