You are here: Re: $_SERVER[] « All PHP « IT news, forums, messages
Re: $_SERVER[]

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация