Page 1 of 1

get url from redirect

Posted: Sun Jan 23, 2005 1:08 pm
by santi
Hi
Im trying to get the url or some information
about external site to redirect to my site

I thin that this site use

Code: Select all

header(location "mysite");
becouste I get no value on

Code: Select all

$HTTP_REFERER
;

Its possible get some info about this external site ??

thanks

Posted: Sun Jan 23, 2005 1:11 pm
by feyd
$_SERVER['HTTP_REFERER']

however, do not assume it exists or is even valid. It's an optional component of the request headers, and as such may not exist or may be filtered out by something the user is communicating through.

Posted: Sun Jan 23, 2005 1:17 pm
by santi

Posted: Sun Jan 23, 2005 1:19 pm
by feyd
it works from here, if I send the referrer information.

Posted: Sun Jan 23, 2005 1:23 pm
by santi
I asum that they no send the referer information
Can I get other information ??

thanks

Posted: Sun Jan 23, 2005 1:40 pm
by rehfeld
make all the links in your website like this

somepage.php?came_from=path/to/this_page_name.foo



or you can use sessions to pass the last page they viewed


as far as getting where they came from if the last page was not on your website, the only chance is the browsers referrer header, which isnt very reliable

Posted: Sun Jan 23, 2005 1:43 pm
by feyd
if they don't provide it.. there's pretty much nothing you can do about it.

A page redirect alone, typically will pass on whatever referrer information was supplied to the first page. In your link, this is the case. Now, if you simply click on your link here, most likely, you will get the referrer information that will say this page.

Posted: Sun Jan 23, 2005 2:13 pm
by santi
Well

but, take a look on url
you click on
http://www.santicabanillas.com.ar/redirect.php

and this redirect to
http://www.arraialdajuda.com/santi/get_redirect.php

Code: Select all

header(location "http://www.arraialdajuda.com/santi/get_redirect.php");
the $_SERVER['HTTP_REFERER'] its OK

but I need to get info about the redirect page that it is inside

1. $_SERVER['HTTP_REFERER'] (where you click)
2. http://www.santicabanillas.com.ar/redirect.php
(I need info about this page)
3. http://www.arraialdajuda.com/santi/get_redirect.php (final page)

Posted: Sun Jan 23, 2005 2:21 pm
by feyd
use a meta-refresh style redirect then...

Posted: Sun Jan 23, 2005 2:36 pm
by santi
sorry about my english

I dont need redirect
I need get information about the page that do the redirection

some external website do a redirect to my website
and I need to get informacion about this external website
to cancel the redirection

example
you have a domain http://www.xxxx.com
and install an index.php
> http://www.xxxx.com/index.php
header(location "my site");

I need to get info about http://www.xxxx.com to cancel this redirection

Posted: Sun Jan 23, 2005 2:44 pm
by feyd
if the information isn't sent, you have no way of knowing.

Posted: Sun Jan 23, 2005 2:57 pm
by santi
Well
very thanks for your time