Page 1 of 1
How to get page url?
Posted: Wed Jul 08, 2009 4:11 am
by rei27
Hello,
I need to get the page url, e.g.
http://www.sekataplus.com/product_detai ... 0864fad1d7
I am using
'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], but it just capture the
http://www.sekataplus.com.
How can i solve this?
Re: How to get page url?
Posted: Wed Jul 08, 2009 4:19 am
by SvanteH
That works fine by me when testing. REQUEST_URI returns the GET request so that should be it. Do you have any more code snippet on which page you're trying to capture it from etc.
Re: How to get page url?
Posted: Wed Jul 08, 2009 4:40 am
by rei27
SvanteH wrote:That works fine by me when testing. REQUEST_URI returns the GET request so that should be it. Do you have any more code snippet on which page you're trying to capture it from etc.
The code works fine when i am in localhost, but when i put it into live server, it just can capture the server.
Re: How to get page url?
Posted: Wed Jul 08, 2009 4:41 am
by SvanteH
What exactly are you trying to use this for?
Re: How to get page url?
Posted: Wed Jul 08, 2009 4:57 am
by rei27
SvanteH wrote:What exactly are you trying to use this for?
I need capture the url and store it into database in order to record the visitor hit for this page!
Re: How to get page url?
Posted: Wed Jul 08, 2009 5:11 am
by SvanteH
Sounds very odd if your production server fails to put any values into $_SERVER["REQUEST_URI"] to be honest.
Re: How to get page url?
Posted: Wed Jul 08, 2009 8:33 pm
by rei27
SvanteH wrote:Sounds very odd if your production server fails to put any values into $_SERVER["REQUEST_URI"] to be honest.
Thanks a lot, i got the solution. I just put
$_SERVER['QUERY_STRING']