, 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?