View Full Version : Getting address location

07-22-2004, 07:16 PM
Is there anyway to get the address bar location (http://thisserver.com/blah) through server variables? I know you can get the actual path (d:\blah...). I know I could just type it in, but I need it to be dynamic.


07-22-2004, 07:42 PM
Yeah, there isn't one variable that has all of it.

But the four variables you'd need if you want to build a complete URL are:
HTTPS (to determine if it is HTTP or HTTPS)
SERVER_NAME (the www.domain.com part of it)
SCRIPT_NAME (everything past the server name but before the querystring)
QUERY_STRING (any query string if it exists)

But depending on what your doing, you may only need some of those.

This thread also might interest you: http://www.codingforums.com/showthread.php?t=9421

07-22-2004, 08:03 PM
thanks! worked perfectly