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

Posted by Flaming Corncob on 08/19/06 23:35

In article <44e794d7$0$47828$dbd41001@news.wanadoo.nl>,
Juliette <jrf_no_spam@jokeaday.net> wrote:

> 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.

So there's no real way to force a page to check for a certain condition
and reroute itself to itself to set a page for example? ... I pulled it
off by having one single variable used to equal one thing and if it's
not it assumes the user is visiting the site from somewhere other than
in the site itself.. if that happens it sets the key variable to what it
expects and reroutes back to itself passing the key in the url. I just
hoped there was a better way of doing it.

 

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

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