Simple Authentication

Results 1 to 5 of 5

Thread: Simple Authentication

  1. #1
    Rob Guest

    Default Simple Authentication

    I think I&#039ve followed your tutorial exactly. Especially the part about putting the conditional statement:<BR>&#060;% <BR>If Session("bolAuthenticated") = False Then<BR> Response.Redirect "/authenticate.asp?" & Request.ServerVariables("SCRIPT_NAME")<BR>End If <BR> %&#062;<BR>at the beginning of the page before any &#060;html&#062;. The result I get is this(view source):<BR><BR>If Session("bolAuthenticated") = False Then<BR> Response.Redirect "/authenticate.asp?" & Request.ServerVariables("SCRIPT_NAME")<BR>End If <BR><BR><BR>&#060;html&#062;<BR>&#060;head&#062;<B R> &#060;Title&#062;Northwest Administrators, Inc.&#060;/title&#062;<BR> &#060;META name="keywords" content=""&#062;<BR> &#060;META name="description" content=""&#062;<BR> &#060;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1"&#062;<BR> <BR> <BR> &#060;!-- LINK TO STYLESHEET --&#062;<BR> &#060;link rel=stylesheet type="text/css" href="/rob/nwa/common/main.css"&#062;<BR> <BR> <BR> &#060;script language="JavaScript"&#062;<BR> &#060;!-- <BR> //Suppress JavaScript errors<BR> function stopError() {<BR> return true;<BR> }<BR> window.onerror = stopError;<BR> // --&#062;<BR> &#060;/script&#062;<BR> <BR>&#060;/head&#062;<BR><BR>How is the page even seeing the if statement inside the &#060;% %&#062; tags and no response.redirect occurs.<BR><BR>Help please.<BR><BR>-rob

  2. #2
    Join Date
    Dec 1969
    Posts
    730

    Default RE: Simple Authentication

    I cut and pasted your code into an ASP and it worked as expected (i.e., I was redirected to authenticate.asp). I got a result like you describe when I put the code into an HTML file. Are you sure you saved your file with the correct extension?<BR>

  3. #3
    Rob Guest

    Default RE: Simple Authentication

    Positive....the page name is default.asp the whole thing looks like this:<BR><BR>&#060;% <BR>If Session("bolAuthenticated") = False Then<BR> Response.Redirect "/authenticate.asp?" & Request.ServerVariables("SCRIPT_NAME")<BR>End If <BR> %&#062;<BR><BR>&#060;html&#062;<BR>&#060;head&#062 ;<BR> &#060;Title&#062;Northwest Administrators, Inc.&#060;/title&#062;<BR> &#060;META name="keywords" content=""&#062;<BR> &#060;META name="description" content=""&#062;<BR> &#060;META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1"&#062;<BR> &#060;!--#include virtual="/nwa/common/clientscript.inc"--&#062;<BR>&#060;/head&#062;<BR><BR><BR>&#060;!--#include virtual="/nwa/pension/local.inc"--&#062;<BR>&#060;img src="/nwa/images/pension_estimate.gif" border="0" width="400" height="70" alt="Pension Estimates"&#062;<BR><BR><BR><BR><BR>&#060;!--#include virtual="/nwa/common/footer.inc" --&#062;<BR><BR>I brought it home with me from work and I run run IIS 5.0 on Win 2000 and still no luck but I do need a solution for simple security so I&#039ll keep trying.<BR><BR>Thanks for the quick response.<BR><BR>-rob

  4. #4
    ASP_DRUG_DEALER Guest

    Default RE: Simple Authentication

    If your using Visual Interdev...Your saving it as Unicode ASP file. You will still get the *.asp file, just wrong format. Try resaving it, or open it in notepad (good old days) and then save it with the ASP format.<BR><BR>Hope this helps...<BR>DRUG_DEALER


  5. #5
    Rob Guest

    Default RE: Simple Authentication

    It works!!! Thank you very much.

Posting Permissions

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