Experience, to find home and uri
Home: http://web.ist.utl.pt/~mcasquilho
Uri: http://web.ist.utl.pt/~mcasquilho/text/php.php
Conclusion   The easiest way to get the root seems to be (see table) the association of http_referer with, namely, php_self. The problem, however, is that http_referer is not reliable. [This can be verified if you enter this page directly (writing its address in the address bar).] The method is to get a substring of http_referer till the string that is common with php_self. In this site, this common string would be "/~mcasquil".

1) ps: ~mcasquilho/text/php.php %  home: http://web.ist.utl.pt/~mcasquilho %
2) hr: %  home: %
Http_referer: (the calling page, if any)
Request_uri: /~mcasquilho/text/php.php PHP variable
Document_root: /var/www/web.ist.utl.pt --
• Http_host: web.ist.utl.pt Server variable
• Php_self: /~mcasquilho/text/php.php PHP predefined variable
Included from home (an example):
Hello, World !
You are connecting from IP = 18.226.214.91.
Browser: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Copyright © 2024 All rights reserved.
 
 
Valid HTML 4.01! IST http://web.ist.utl.pt/~mcasquilho/text/php.php
Created: ~1999 — Last modified:2007-01-16