Looking for complete entered URL
| From: | Angela Barone | Date: | Sat, 20 Apr 2013 18:51:37 +0000 |
| Subject: | Looking for complete entered URL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-320915@lists.php.net to get a copy of this message | ||
I've written a script that logs all visits to a web site, complete with referrer and IP
address. It also logs all 4xx errors. What I'd like to add to this is, if someone adds extra
code after the page_name.php, to be able to capture any extra code and log that.
I've tried:
$_SERVER['QUERY_STRING']
$_SERVER['REDIRECT_QUERY_STRING']
$_SERVER['REDIRECT_URL']
but nothing seems to get logged.
Is there a way, when either a false url is entered and a 404 is generated, or just when someone
tacks on extra code to the URL, that I can grab that extra info? I'm looking for the complete
URL that was entered by the user, not anything returned by the server.
I've created my own 4xx_error.php files which calls my tracking script, along with creating
the proper ErrorDocument lines in the main ..htaccess file.
There are a lot of pages that have come up in my search, but nothing seems to pertain to what
I'm trying to do.
Thank you,
Angela
BTW, I know about Piwik and I use that, as well. This is something I'm doing on my own.