| | |
help me please. i am making a login page..
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Hello,
I am in the way to make a login page for my new website. It must be a database driven login page.
details:
fields: username, password
database: MS Access
the guest who registering with these field; result must gone to database. so login is in compare with the above said database..
I hope somebody can help me.....
I am in the way to make a login page for my new website. It must be a database driven login page.
details:
fields: username, password
database: MS Access
the guest who registering with these field; result must gone to database. so login is in compare with the above said database..
I hope somebody can help me.....
•
•
Join Date: Oct 2007
Posts: 4
Reputation:
Solved Threads: 0
Create the database that should contains following fields
UserId,Username, password and some othere details of the user. Make UserId as Primarykey in the database.
Design Login page. mach the login user with the username and password using simple coditions if valid allow him inside other wise give message to him.
if the login user is new user provide the interface such that he can provide his infomation. and store the information in the same table.
UserId,Username, password and some othere details of the user. Make UserId as Primarykey in the database.
Design Login page. mach the login user with the username and password using simple coditions if valid allow him inside other wise give message to him.
if the login user is new user provide the interface such that he can provide his infomation. and store the information in the same table.
•
•
Join Date: Sep 2006
Posts: 50
Reputation:
Solved Threads: 0
If it is new user he must go to registeration page as well to store his or her information
thanks
www.globalsoftsols.com
thanks
www.globalsoftsols.com
•
•
•
•
Create the database that should contains following fields
UserId,Username, password and some othere details of the user. Make UserId as Primarykey in the database.
Design Login page. mach the login user with the username and password using simple coditions if valid allow him inside other wise give message to him.
if the login user is new user provide the interface such that he can provide his infomation. and store the information in the same table.
Last edited by david_123; Nov 7th, 2007 at 3:09 am. Reason: small correction
•
•
Join Date: Sep 2007
Posts: 1,080
Reputation:
Solved Threads: 68
Your best bet is to pull some information out of the database to see if a user exists with your currently supplied information from the user. Use an sql query like the one below, with the code below:
ASP Syntax (Toggle Plain Text)
<% Response.Buffer = true Session("DatabasePath") = "Path to your database, put it here. rest will fill in for you" If Request.Form("btnLogin") = "Login" AND Request.Form("txtUserName") <> "" AND Request.Form("txtPassword") <> "" Then Dim conn, strSQL, rs strUserName = MakeSQLSafe(Trim(Request.Form("txtName"))) strPassword = MakeSQLSafe(Trim(Request.Form("txtPassword"))) Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Session("DatabasePath") & ";" strSQL = "SELECT UserName, UserID FROM Users WHERE UserName='" & strUserName & "' AND UserPassword='" & strPassword & "'" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open strSQL, , 0, 2 If Not rs.EOF Then Session("logged") = 1 Session("UserName") = rs("UserName") Session("UserID") = rs("UserID") Else Response.Redirect ("register.asp?login=failed") End If rs.Close() conn.Close() set rs = nothing set conn = nothing Else response.redirect ("login.asp?fields=null") End If Function MakeSQLSafe(sender) sender = Replace(sender, ";", "") sender = Replace(sender, """", "") sender = Replace(sender, "'", "") sender = Replace(sender, "''", "") Return(sender) End Function %>
![]() |
Similar Threads
- Updated : Simple ASP.Net Login Page (ASP.NET)
- problem with login page (C#)
- Simple ASP.Net Login Page (Using VB.Net) (ASP.NET)
- Error message when running ASP login page (ASP)
Other Threads in the ASP Forum
- Previous Thread: need help how to produce a txt file after email being sent in ASP
- Next Thread: parameter passing thru on click for different buttons
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7






