The script should be pulling that from the $SERVER["PATHINFO"] variable.
I just tried it on a PHP 5 domain and it worked, but I don't know if anything is different with PHP 4 -- which is your domain set to? If it's 4, you could give 5 a try.
Just edit the domain settings and it will be near the top, in the fully-hosted section of the page.
Maximum savings promo code: MaxSavingsAtDH