So, I found a way to get the current directory using dirname(__FILE__) and get the domain using $_SERVER['HTTP_HOST'] . Although both are good and good, they are not exactly what I need.
For example, if I have a script at http://mydomain.com/scripts/myscript.php , I would like to get http://mydomain.com/scripts/ . I feel that there should be an easy way to do this, and that I somehow forgot something.
As an aside, I'm currently using a script in a cloud shared hosting environment, so the directory structure is somewhat odd.
Jim p source share