VB ASP form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • j0rdanf1
    New Member
    • Oct 2006
    • 35

    VB ASP form

    Hey,

    I have been working on creating a basic login for a website now for 2 days and still have gotten no further.

    So far I think the form is correct, it has to fields a username and a password field, this then gets submitted to the check.asp via the post method then the vb script is meant to link to the sql database and validate if the login information is present in the database. If it is redirect to welcome.asp, else goto login.asp

    Here's what I have so far

    login.asp

    Code:
    <html>
    <head>
    <title>login</title>
    </head>
    
    <body>
    <form action="check.asp" method="post" name="login">
        <table>
    	<tr>
    	<td><span class="style14">Username:</span> </td>
    	<td><input name="username" type="text" size="30" maxlength="25" /></td>
    	</tr>
    	<tr>
    	<td><span class="style14">Password:</span></td>
    	<td><input name="password" type="password" size="30" maxlength="25" /></td>
    	</tr>
    	<tr>
    	<td><div align="left"><a href="register.asp" class="style13">Sign up....  </a></div></td>
    	<td align=right><input type="image" src="submit.jpg" alt="loginsubmit"/></td>
    	</tr>
    	</table>   
    	</form>
    </body>
    </html>
    check.asp

    Code:
    <%
    '#Connect to SQL database#'
    Dim objConn
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "dsn=Oracle;uid=username;pwd=password;"
    %>
    
    <%
    intUserid = Request.form("intUserid")
    txtUserpwd = Request.form("txtUserpwd")
    %>
    <%
    strSQL = "SELECT * FROM tblUser WHERE intUserid = '"&intUserid&"' AND txtUserpwd = '"&txtUserpwd&"'"
    
    Set objRs = objConn.execute(strSQL)
    
    If (objRs.BOF) then 
    Response.Redirect "login.asp?fail try again"
    Else 
    Response.Cookies("login")("intUserid") = intUserid
    Response.Cookies("login").Expires = Date + 1
    Response.Redirect "welcome.asp"
    
    End If
    %>
    Any ideas guys?
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    #2
    Originally posted by j0rdanf1
    Hey,

    I have been working on creating a basic login for a website now for 2 days and still have gotten no further.

    So far I think the form is correct, it has to fields a username and a password field, this then gets submitted to the check.asp via the post method then the vb script is meant to link to the sql database and validate if the login information is present in the database. If it is redirect to welcome.asp, else goto login.asp

    Here's what I have so far

    Any ideas guys?
    What exactly do you want help with?

    Comment

    • j0rdanf1
      New Member
      • Oct 2006
      • 35

      #3
      Originally posted by daniel aristidou
      What exactly do you want help with?
      its ok came up with a solution, cheers though

      Comment

      • red3recon
        New Member
        • Feb 2008
        • 1

        #4
        Originally posted by j0rdanf1
        its ok came up with a solution, cheers though
        What was your solution?

        Comment

        Working...