Results 1 to 3 of 3

Thread: Prevent opening page

  1. #1

    Thread Starter
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Question Prevent opening page

    Hi everyone.

    I'm kinda new to ASP I need your help in my login form.

    I already coded the login/pword authentication. I have a question though. How do i prevent users from bypassing the login form.

    What is the code to make sure a page underwent a login authentication first?

    Here is a snippet of my login/password code.

    Code:
    strSQL="SELECT * FROM Table WHERE Login = '" & request.form("userfield") & "' and Password = '" & request.form("pwordfield") & "'"
    set rs = Global_DBConnection.execute(strSQL)
    
    dim blnAuth
    
    If Not (rs.EOF and rs.BOF) Then
    	blnAuth = True
    End if
    
    if blnAuth = True then
    	response.Redirect("success.html")
    	response.End()
    elseif blnAuth = False then
    	response.Redirect("Fail.html")
    	response.End()
    end if
    
    set rs = nothing
    Now in this example i want to protect the success.html for any bypass. Thanks in advance.

    -zynder

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Prevent opening page

    you wouldn't use an html page... usually the way these things work is upon sucessful login, a cookie is set... then you redirect to a new page... then you page (in fact ALL pages) will need to check that cookie. if it's set, then the user has logged in and can proceed. If it isn't set, then they are sent back to the login page. all of this requires server side processing, either in ASP or PHP or Perl, or something, and so isn't usually done with just html.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Frenzied Member zynder's Avatar
    Join Date
    Nov 2006
    Location
    localhost
    Posts
    1,434

    Re: Prevent opening page

    Thanks for the tip. Yes i will change it to asp. I'm just trying to grasp this asp/server side scripting.
    OK now do you have some links on cookie tutorials? That's just i need methinks.

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