Well, Apache 1.3 at least has $ENV{'SCRIPT_URI'} and $ENV{'QUERY_STRING'}, which can easily be combined to give you the full URL with parameters. (This is probably in all Apache versions, but I am not familiar with anything else.) Does it need to be portable across all servers, or do you know exactly which server your script will be running on?
---
It's all fine and dandy until someone has to look at the code.
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.
I am writing a hack for a forum I am using for my site. I want it to display where the users of the forum are. This would be for the admins to see where the current activity is by seeing what part of the forum all the people are looking at.
It would be far too long to actually modify the forum itself, I just want to make a snippet and load it into the main .pl file.