Get referer with PHP

Get referer with PHP

am 12.06.2007 15:00:47 von luis.moreira

Hi

This is possibly way too simple, but let me ask just the same :

I want to add some code (may be PHP) on an HTML page, to check the
referrer.
It has to be web-server independent.
If the page is invoked by URL X, ok, if not, the page should not be
shown.

Can this be done ?

Thanks
Luis

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Get referer with PHP

am 12.06.2007 15:06:58 von Bradley Stahl

------=_Part_3582_11639781.1181653618444
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Luis,

Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL of
the page that referred the current user to your page. Let me know if this
helps.

--Brad

On 6/12/07, Luis Moreira (ESI-GSQP) wrote:
>
> Hi
>
> This is possibly way too simple, but let me ask just the same :
>
> I want to add some code (may be PHP) on an HTML page, to check the
> referrer.
> It has to be web-server independent.
> If the page is invoked by URL X, ok, if not, the page should not
> be
> shown.
>
> Can this be done ?
>
> Thanks
> Luis
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

------=_Part_3582_11639781.1181653618444--

RE: Get referer with PHP

am 12.06.2007 15:26:00 von Gustav Wiberg

Hi there!

If you mean independet of webserver, then try using Javascript. I don't kno=
w the command for retrieving URL in Javascript, but I'm pretty sure there=
=20
Is one out there.

Best regards
/Gustav Wiberg
=20

-----Original Message-----
From: Bradley Stahl [mailto:bradley.stahl@gmail.com]=20
Sent: Tuesday, June 12, 2007 3:07 PM
To: Luis Moreira (ESI-GSQP)
Cc: php-windows@lists.php.net
Subject: Re: [PHP-WIN] Get referer with PHP

Luis,

Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL of
the page that referred the current user to your page. Let me know if this
helps.

--Brad

On 6/12/07, Luis Moreira (ESI-GSQP) wrote:
>
> Hi
>
> This is possibly way too simple, but let me ask just the same :
>
> I want to add some code (may be PHP) on an HTML page, to check th=
e
> referrer.
> It has to be web-server independent.
> If the page is invoked by URL X, ok, if not, the page should not
> be
> shown.
>
> Can this be done ?
>
> Thanks
> Luis
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Get referer with PHP

am 12.06.2007 15:26:22 von Stut

Bradley Stahl wrote:
> Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL of
> the page that referred the current user to your page. Let me know if this
> helps.

Note that this cannot be relied upon. A fair number of proxies and even
some browsers have the option to remove or not supply this header.

-Stut

> On 6/12/07, Luis Moreira (ESI-GSQP) wrote:
>>
>> Hi
>>
>> This is possibly way too simple, but let me ask just the same :
>>
>> I want to add some code (may be PHP) on an HTML page, to check
>> the
>> referrer.
>> It has to be web-server independent.
>> If the page is invoked by URL X, ok, if not, the page should not
>> be
>> shown.
>>
>> Can this be done ?
>>
>> Thanks
>> Luis
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: Get referer with PHP

am 12.06.2007 15:35:46 von luis.moreira

True

I tested, for now, on my own PC running Apache, and it does work.
I will try to find a javascript option, but for now I already have =
something
that does the trick, providing the info is there.

Thanks

-----Original Message-----
From: Stut [mailto:stuttle@gmail.com]=20
Sent: ter=E7a-feira, 12 de Junho de 2007 14:26
To: Bradley Stahl
Cc: Luis Moreira (ESI-GSQP); php-windows@lists.php.net
Subject: Re: [PHP-WIN] Get referer with PHP

Bradley Stahl wrote:
> Try using the "$_SERVER['HTTP_REFERER']" server variable to get the =
URL of
> the page that referred the current user to your page. Let me know if =
this
> helps.

Note that this cannot be relied upon. A fair number of proxies and even=20
some browsers have the option to remove or not supply this header.

-Stut

> On 6/12/07, Luis Moreira (ESI-GSQP) wrote:
>>
>> Hi
>>
>> This is possibly way too simple, but let me ask just the same =
:
>>
>> I want to add some code (may be PHP) on an HTML page, to =
check=20
>> the
>> referrer.
>> It has to be web-server independent.
>> If the page is invoked by URL X, ok, if not, the page should =
not
>> be
>> shown.
>>
>> Can this be done ?
>>
>> Thanks
>> Luis
>>
>> --=20
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>=20

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Get referer with PHP

am 12.06.2007 15:43:00 von Bradley Stahl

------=_Part_4190_21683079.1181655780687
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Stut,

I did not know that. Do you have any documentation on this? I would really
like to read more about this issue. Thanks for the heads up.

-Brad

On 6/12/07, Stut wrote:
>
> Bradley Stahl wrote:
> > Try using the "$_SERVER['HTTP_REFERER']" server variable to get the URL
> of
> > the page that referred the current user to your page. Let me know if
> this
> > helps.
>
> Note that this cannot be relied upon. A fair number of proxies and even
> some browsers have the option to remove or not supply this header.
>
> -Stut
>
> > On 6/12/07, Luis Moreira (ESI-GSQP) wrote:
> >>
> >> Hi
> >>
> >> This is possibly way too simple, but let me ask just the same :
> >>
> >> I want to add some code (may be PHP) on an HTML page, to check
> >> the
> >> referrer.
> >> It has to be web-server independent.
> >> If the page is invoked by URL X, ok, if not, the page should
> not
> >> be
> >> shown.
> >>
> >> Can this be done ?
> >>
> >> Thanks
> >> Luis
> >>
> >> --
> >> PHP Windows Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
>
>

------=_Part_4190_21683079.1181655780687--

Re: Get referer with PHP

am 12.06.2007 15:59:27 von Stut

Bradley Stahl wrote:
> I did not know that. Do you have any documentation on this? I would
> really like to read more about this issue. Thanks for the heads up.

There is no documentation on this beyond the HTTP spec not requiring
that this header is set, so I'm not really sure where I can point you.

-Stut

> On 6/12/07, * Stut* > wrote:
>
> Bradley Stahl wrote:
> > Try using the "$_SERVER['HTTP_REFERER']" server variable to get
> the URL of
> > the page that referred the current user to your page. Let me
> know if this
> > helps.
>
> Note that this cannot be relied upon. A fair number of proxies and even
> some browsers have the option to remove or not supply this header.
>
> -Stut
>
> > On 6/12/07, Luis Moreira (ESI-GSQP) > > wrote:
> >>
> >> Hi
> >>
> >> This is possibly way too simple, but let me ask just the
> same :
> >>
> >> I want to add some code (may be PHP) on an HTML page, to
> check
> >> the
> >> referrer.
> >> It has to be web-server independent.
> >> If the page is invoked by URL X, ok, if not, the page
> should not
> >> be
> >> shown.
> >>
> >> Can this be done ?
> >>
> >> Thanks
> >> Luis
> >>
> >> --
> >> PHP Windows Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
>
>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Get referer with PHP

am 12.06.2007 16:02:37 von Bradley Stahl

------=_Part_4430_29573729.1181656957375
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

No problem. Thanks.

On 6/12/07, Stut wrote:
>
> Bradley Stahl wrote:
> > I did not know that. Do you have any documentation on this? I would
> > really like to read more about this issue. Thanks for the heads up.
>
> There is no documentation on this beyond the HTTP spec not requiring
> that this header is set, so I'm not really sure where I can point you.
>
> -Stut
>
> > On 6/12/07, * Stut* >
> wrote:
> >
> > Bradley Stahl wrote:
> > > Try using the "$_SERVER['HTTP_REFERER']" server variable to get
> > the URL of
> > > the page that referred the current user to your page. Let me
> > know if this
> > > helps.
> >
> > Note that this cannot be relied upon. A fair number of proxies and
> even
> > some browsers have the option to remove or not supply this header.
> >
> > -Stut
> >
> > > On 6/12/07, Luis Moreira (ESI-GSQP) > > > wrote:
> > >>
> > >> Hi
> > >>
> > >> This is possibly way too simple, but let me ask just the
> > same :
> > >>
> > >> I want to add some code (may be PHP) on an HTML page, to
> > check
> > >> the
> > >> referrer.
> > >> It has to be web-server independent.
> > >> If the page is invoked by URL X, ok, if not, the page
> > should not
> > >> be
> > >> shown.
> > >>
> > >> Can this be done ?
> > >>
> > >> Thanks
> > >> Luis
> > >>
> > >> --
> > >> PHP Windows Mailing List (http://www.php.net/)
> > >> To unsubscribe, visit: http://www.php.net/unsub.php
> > >>
> > >>
> > >
> >
> >
>
>

------=_Part_4430_29573729.1181656957375--