Using ASP HTTP_REFERER server variable to choose between 2 differentincludes files?

Discussion in 'ASP .Net' started by DC, Jan 24, 2008.

  1. DC

    DC Guest

    Is ther an easy way of using the HTTP_REFERER server variable to choose
    between 2 different includes files?

    Eg:

    <%
    If HTTP_REFERER="Url 1" then

    <!--#include virtual="/includes/menustyle1.html" -->

    else

    <!--#include virtual="/includes/menustyle1.html" -->

    EndIf
    %>

    Obviouslythe above wont work due to bracketing, but is there an easy way
    around this?

    Thanks in advance,

    DC
    DC, Jan 24, 2008
    #1
    1. Advertising

  2. Re: Using ASP HTTP_REFERER server variable to choose between 2 different includes files?

    "DC" <> wrote in message
    news:fnafbf$sm8$...

    > Is there an easy way of using the HTTP_REFERER server variable to choose
    > between 2 different includes files?


    Before you go much further with this, I should point out that HTTP_REFERER
    cannot be relied upon at all on the public Internet, as more and more ISPs
    are stripping this off web requests...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Jan 24, 2008
    #2
    1. Advertising

  3. Re: Using ASP HTTP_REFERER server variable to choose between 2 different includes files?

    Not like this. Keep in mind, asp commands are processed after things like
    server side includes so this method will result in you having the two files
    included in the page before ASP begins processing.

    Just an FYI, this is not the ASP newsgroup, this is ASP.Net so you won't get
    many helpful answers here. For questions regarding classic ASP you may want
    to go to the microsoft.public.inetserver.asp.general newsgroup instead.


    --
    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - Expression


    "DC" <> wrote in message
    news:fnafbf$sm8$...
    > Is ther an easy way of using the HTTP_REFERER server variable to choose
    > between 2 different includes files?
    >
    > Eg:
    >
    > <%
    > If HTTP_REFERER="Url 1" then
    >
    > <!--#include virtual="/includes/menustyle1.html" -->
    >
    > else
    >
    > <!--#include virtual="/includes/menustyle1.html" -->
    >
    > EndIf
    > %>
    >
    > Obviouslythe above wont work due to bracketing, but is there an easy way
    > around this?
    >
    > Thanks in advance,
    >
    > DC
    Mark Fitzpatrick, Jan 24, 2008
    #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. Elliot M. Rodriguez
    Replies:
    1
    Views:
    632
    bruce barker
    Feb 12, 2004
  2. =?Utf-8?B?cHBhdGVs?=

    Request.ServerVariables ("HTTP_REFERER") using https

    =?Utf-8?B?cHBhdGVs?=, Mar 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,530
    Eric Lawrence [MSFT]
    Mar 3, 2004
  3. Drebin
    Replies:
    15
    Views:
    13,860
    slyi .
    Nov 23, 2004
  4. Robert Mark Bram

    asp javascript HTTP_REFERER is or is not undefined?

    Robert Mark Bram, Aug 2, 2004, in forum: ASP General
    Replies:
    7
    Views:
    354
    Stefan Berglund
    Aug 3, 2004
  5. alex p
    Replies:
    2
    Views:
    158
    alex p
    Jan 9, 2005
Loading...

Share This Page