sooty2006 Posted October 4, 2009 Share Posted October 4, 2009 im trying to log infomation from a 403 errorthere are files i dont not want users to access,so when they visit the url it gives a 403 forbidden error.but i want to make a log of the pages that are trying to be visited and there ip is there any way of posting DOCUMENT_ROOT & REMOTE_ADDR using the .htaccess?if not is there any other way?many thanks scott. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 5, 2009 Share Posted October 5, 2009 Look into custom error files, you should be able to set your own PHP script as an error page and use it to log whatever you want. Link to comment Share on other sites More sharing options...
sooty2006 Posted October 5, 2009 Author Share Posted October 5, 2009 i have my own custom made error files but when i request the DOCUMENT_ROOT & REQUEST_URI on that php page it redirects to, it shows that page i want it to show the file it came from.ie. error 403 custom file is httpdocs/e_handler/403.phpsay i accessed: httpdocs/_dir/_config/functions.phpwhen it redirects to the 403.php file and try to get the accessed folder name it returns the e_handler folder..is there a way i can post the DOCUMENT_ROOT to the custom made 403 error?thanks. Link to comment Share on other sites More sharing options...
sooty2006 Posted October 9, 2009 Author Share Posted October 9, 2009 i have my own custom made error files but when i request the DOCUMENT_ROOT & REQUEST_URI on that php page it redirects to, it shows that page i want it to show the file it came from.ie. error 403 custom file is httpdocs/e_handler/403.phpsay i accessed: httpdocs/_dir/_config/functions.phpwhen it redirects to the 403.php file and try to get the accessed folder name it returns the e_handler folder..is there a way i can post the DOCUMENT_ROOT to the custom made 403 error?thanks. Link to comment Share on other sites More sharing options...
shadowayex Posted October 9, 2009 Share Posted October 9, 2009 The only way I can see to do this is to add something like this to the functions.php page:$_SESSION['document_root'] = $_SERVER['DOCUMENT_ROOT'];As far as I know, there's no way to get the DOCUMENT_ROOT of the HTTP_REFERER. I could be wrong, but that's just based off of what I know. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.