onewaylife Posted May 9, 2007 Share Posted May 9, 2007 hi this is my root document path include_once ("C:/wwwroot/user/oneadmin/config.php" can it possible to trace the path of my root document by php functions ??? and if then how to hide the path of root document... ??? with regards onewaylife Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/ Share on other sites More sharing options...
chronister Posted May 9, 2007 Share Posted May 9, 2007 generally the only time your document paths are visible to the public space is when errors are reported. For example, mistype the name of that config.php file and watch the error. As long as you have the errors under control and have a graceful way for your script to die or return an error written by you, then you should be alright. The other measure is to turn error reporting off altogether for a site. You can do this in the PHP.ini file or you can do this. error_reporting(E_WARNING); ini_set('display_errors', '0'); But you must remember that once a person can see the page on screen PHP is done doing what it is going to do. PHP is server side, so it is pretty secure in that your php code cannot be seen without File level access or by chance the PHP installation gets messed up and it is not parsing the php code. then your code will be outputted as HTML. If I am wrong about these things, then please someone let me know. Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-248760 Share on other sites More sharing options...
jitesh Posted May 9, 2007 Share Posted May 9, 2007 Run this you will get some idea. <?php echo "<pre>"; print_r($_SERVER); ?> Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-248761 Share on other sites More sharing options...
onewaylife Posted May 9, 2007 Author Share Posted May 9, 2007 so, how to hide the document path?? ??? Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-248865 Share on other sites More sharing options...
jitesh Posted May 9, 2007 Share Posted May 9, 2007 echo $_SERVER['DOCUMENT_ROOT']; Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-248866 Share on other sites More sharing options...
onewaylife Posted May 9, 2007 Author Share Posted May 9, 2007 jitesh, $_SERVER['DOCUMENT_ROOT'] will give me the path but how to use it to hide the path of my document. if posible explain with example. Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-248916 Share on other sites More sharing options...
jitesh Posted May 9, 2007 Share Posted May 9, 2007 Why do you want to hide the path at include ? Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-248946 Share on other sites More sharing options...
taith Posted May 9, 2007 Share Posted May 9, 2007 lets just say no... if you want to include a file, you must have the filepath typed out somewhere... wether you hide a define somewhere and just use its key... or make it a variable somewhere, you still need to have it in there... now... php is server side... so nomater what way you do it... the only way to find that filepath, is to have file level access(ftp/filemanager) and view the file directly... Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-248950 Share on other sites More sharing options...
onewaylife Posted May 10, 2007 Author Share Posted May 10, 2007 Why do you want to hide the path at include ? I don't want to show the file directory in my url like if i have two folder like admin and user . when user login a/c to their privilages they will directed to admin or user folder so inthe url admin or user folder shown that i don't want to show it so how to avoid it.. Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-249572 Share on other sites More sharing options...
roopurt18 Posted May 10, 2007 Share Posted May 10, 2007 You want mod_rewrite then. http://www.phpfreaks.com/forums/index.php/board,50.0.html Quote Link to comment https://forums.phpfreaks.com/topic/50606-how-to-hide-the-document-path/#findComment-249580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.