Page 1 of 1

Retreive data...

Posted: Sun Nov 27, 2005 3:49 pm
by shoxlx
Is their a way to get the information from the address bar?

Re: Retreive data...

Posted: Sun Nov 27, 2005 3:53 pm
by foobar
shoxlx wrote:Is their a way to get the information from the address bar?
You can't read what the user typed in at a given moment, but you can use the following to find what URL is currently being called:

Code: Select all

$url = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
If you want to know what the user just typed in, you'll have to use JS. AFAIK there is a way of finding out, but I'm not that great with JS.

Posted: Sun Nov 27, 2005 3:55 pm
by Jenk
$_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI']

Though be warned, XSS/Injection is an issue with these.