Okay, that's good to know. Now another question - what are you going to use the URL for? Meaning, why does the script need to know it's own URL? Your answer might reveal another way to accomplish the same task.
---
It's all fine and dandy until someone has to look at the code.