CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2000
    Location
    Birmingham, England
    Posts
    2,520

    Active Server Pages - Request object

    Hi,

    I am looking through some ASP and trying to determine where an item of data is coming from.
    There is a stock ASP object called 'Request', which has a collection called 'Server.Variables'. Ihave take a look on MSDN at a list of predefined variables that apply, yet the one i am looking for is NOT in the predefined list and taking a search through all my .asp and .js pages fails to show where it is being defined.

    I am trying to determine where the variable HTTP_HOST comes from. This is how it looks in my asp pages ...

    Session("DLAM").HostPath = "http://" & Request.ServerVariables("HTTP_HOST") & "/oasis/uk/images/"

    Now, HTTP_HOST returns the name of the server upon which IIS is running, but HOW does it get set ? Where does the value come from ?

    MSDN states ...


    HTTP_<HeaderName> The value stored in the header HeaderName. Any header other than those listed in this table must be prefixed by HTTP_ in order for the ServerVariables collection to retrieve its value.
    Note The server interprets any underscore (_) characters in HeaderName as dashes in the actual header. For example if you specify HTTP_MY_HEADER, the server searches for a header sent as MY-HEADER.


    ... but i do not understand what it means when it talks about 'headers'. Can somebody please help me determine where I might find where HTTP_HOST is being set ? Have you come across it before ? If it's NOT a stock variable then erhaps you could give me some pointers on how these headers work and how asp determines what HOST is, because it is never 'Set' in the code!

    Thanks for your help, sorry for the long post.

    Jase


    <no witty trailer supplied>

    Jase

    www.slideshowdesktop.com
    View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows.
    ...

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Active Server Pages - Request object

    Those are server variables and it is default the name of the computer the server runs on.
    You can change the name through configuration of the IIS, but I can't exactly say how that is done. check out the help files, of the Internet Information Servicemanager

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Mar 2000
    Location
    Birmingham, England
    Posts
    2,520

    Re: Active Server Pages - Request object

    Thanks for your help.

    Your reply enabled me to find the appropriate IIS documentation that details creating new host headers. I appreciate now that HTTP_HOST is value defined in IIS, and that by default it is the DNS name of the server.
    Cheers.

    Jase

    <no witty trailer supplied>

    Jase

    www.slideshowdesktop.com
    View your images and photos on your desktop with ease using SlideShow Desktop, the desktop wallpaper manager for Microsoft Windows.
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured