No, I think this will not work, $PHP_SELF will retun a name and path of a php file, not a .shtml page.
Try using $REQUEST_URI - it's contains parameter of HTTP's GET or POST request, just that your browser tells to web server.
Remember: this can return a full URI, including scheme, hostname, path and document, or just a document name if you're usin relative links.
You may use this function:
array parse_url (string url)
This function returns an associative array returning any of the various components of the URL that are present. This includes the "scheme", "host", "port", "user", "pass", "path", "query", and "fragment".