My project is coming along very well but I've run into something else I cant seem to find  in the docs.

How do I get the URL of my current script (really what I want is the Url of its containing directory, but I can chop it off the end to get that) ?

I've tried the CGI parameters $DOCUMENT_ROOT and $SCRIPT_NAME, but they both appear to be empty.