Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    log in code not working :(

    I tried running the below code using IExplorer.
    Even after entering the username as 'joe' and password as 'please' it is not redirecting me to 'order.asp' instead says incorrect log in details..why??

    Can you help me please
    Thanks in advance!


    <!-- 8-qu 3 order with form.asp -->

    <!-- build output in a buffer then send -->
    <% Response.Buffer = true %>


    <%
    IF Request.form="" THEN
    %>


    <html>
    <head>
    <title>Our private pages</title></head>

    <body>
    In order to access these pages fill the form below:
    <BR>

    <form method="post" action="8-qu 3 order with form.asp">
    Username: <input type="text" name="username" size="20"><BR>
    Password: <input type="password" name="password" size="15"><BR>
    <input type="Submit" value="Submit">
    </form>

    </body>
    </html>

    <%
    ELSE

    IF Request.form("username")="Joe" AND Request.form("password")="please" THEN

    Session("permission")="YES"
    Session("username")="Joe"

    ' Redirect response to a different page
    Response.Redirect("order.asp")

    ELSE
    %>

    Error in username or password
    <%
    END IF ' login authentication
    END IF ' form = ""
    %>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,574
    Thanks
    80
    Thanked 4,620 Times in 4,583 Posts
    Worked fine for me.

    I'm beginnig to suspect that you do *NOT* have ASP running on your web server.

    Try this test page, just to find out:
    Code:
    <html><body>
    If ASP is active you will see the time and date here: <%=Now()%>
    </body></html>
    If you don't see the date and time, then ASP is not working on your server.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

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