|
Posted by Juliette on 08/19/06 22:46
Flaming Corncob wrote:
> In article <44e75e66$0$66091$dbd4d001@news.wanadoo.nl>,
> Juliette <jrf_no_spam@jokeaday.net> wrote:
>
>> Flaming Corncob wrote:
>>> Using $_SERVER['HTTP_REFERER'], you might get (for example)
>>> http://widgets.com/test/test_new.php?page=2. Is there a way to extract
>>> the "widgets.com/test/test_new.php" portion of it and store it in a
>>> string?
>>>
>>> Thanks much.
>>
>> Have a look at: http://www.php.net/parse-url
>
> Yep, saw that after the fact. Unfortunately ended up with another
> problem. Sometimes the url comes through as blank. Nadda. Nothing.
That is not a 'problem', but a feature.
Think real world: someone might have bookmarked the page. No referrer
will be send then.
Also, the referrer can quite easily be spoofed or removed by a
semi-experienced web-user.
Never make your code dependant on it.
Have a look at the documentation of the $_SERVER array and the user
comments.
Navigation:
[Reply to this message]
|