Server Variables

Discussion in 'ASP General' started by Aaron, Oct 23, 2003.

  1. Aaron

    Aaron Guest

    Is there a server var that will give me the entire URL that is in the
    address bar? Currently, I am just adding SERVER_NAME & URL
     
    Aaron, Oct 23, 2003
    #1
    1. Advertising

  2. Aaron

    Ray at Guest

    Something like this - the long and drawn out method

    <%
    Dim sProtocol, sDomain, sPath, sQuerystring
    sResult

    'get protocol
    sProtocol = "http://"
    If UCase(Request.ServerVariabes("HTTPS")) = "ON" Then sProtocol = "https://"

    'get domain
    sDomain = LCase(Request.ServerVariables("SERVER_NAME"))

    'Get path
    sPath = LCase(Request.ServerVariables("SCRIPT_NAME"))

    'Get querystring
    sQuerystring = LCase(Request.Querystring)


    ''put together
    sResult = sProtocol & sDomain & sPath
    If Len(sQuerystring) > 0 Then sResult = sResult & "?" & sQuerystring

    Ray at work



    "Aaron" <> wrote in message
    news:...
    > Is there a server var that will give me the entire URL that is in the
    > address bar? Currently, I am just adding SERVER_NAME & URL
    >
     
    Ray at, Oct 23, 2003
    #2
    1. Advertising

  3. Aaron

    Aaron Guest

    Yes, that is pert-near what I have ... for some reason I thought there
    was a SRVR_VAR that grabbed the entire value of the address bar ... only
    JS perhaps. Thanks!

    Ray at <%=sLocation%> wrote:

    > Something like this - the long and drawn out method
    >
    > <%
    > Dim sProtocol, sDomain, sPath, sQuerystring
    > sResult
    >
    > 'get protocol
    > sProtocol = "http://"
    > If UCase(Request.ServerVariabes("HTTPS")) = "ON" Then sProtocol = "https://"
    >
    > 'get domain
    > sDomain = LCase(Request.ServerVariables("SERVER_NAME"))
    >
    > 'Get path
    > sPath = LCase(Request.ServerVariables("SCRIPT_NAME"))
    >
    > 'Get querystring
    > sQuerystring = LCase(Request.Querystring)
    >
    >
    > ''put together
    > sResult = sProtocol & sDomain & sPath
    > If Len(sQuerystring) > 0 Then sResult = sResult & "?" & sQuerystring
    >
    > Ray at work
    >
    >
    >
    > "Aaron" <> wrote in message
    > news:...
    >
    >>Is there a server var that will give me the entire URL that is in the
    >>address bar? Currently, I am just adding SERVER_NAME & URL
    >>

    >
    >
    >
     
    Aaron, Oct 23, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. avnrao
    Replies:
    0
    Views:
    3,392
    avnrao
    May 7, 2004
  2. Replies:
    1
    Views:
    957
  3. dwok
    Replies:
    7
    Views:
    719
    Hal Rosser
    Mar 4, 2005
  4. -
    Replies:
    2
    Views:
    433
    Alan Krueger
    Jul 29, 2005
  5. Replies:
    9
    Views:
    995
Loading...

Share This Page