Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grab the URL of the address bar using PHP

Status
Not open for further replies.

quarryknight

Programmer
Joined
Jan 1, 2005
Messages
29
Location
US
Hello, I am trying to use PHP to grab the URL of the Address Bar (in Internet Explorer and Mozilla Firefox). Basically, I want to use this functionality to trace the redirection path of a website, where using file_get_contents() will not grab the URL, since the redirection is through a scripting language.

I need to be able to grab the URL from the address bar before the page loads. Thank you very much for your time.

Nick Ruiz
Webmaster, DBA
 
Your PHP script works on the server side, sends a page to the client side then die.
Now a browser shows a page (and its address bar) but where is your PHP script? Well, on the other side (and dead;).
Can this deceased on the other side of Internet grab anything (w/o client-side scripting)?..
 
I'm not sure you know what you want here.

do you a:
want to find out where your users come from?

or b:
want to know where your users are, before they leave your page?

if a:
$_SERVER['HTTP_REFERER']

if b:
$_SERVER['SCRIPT_FILENAME']


Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top