Matar Posted March 7, 2006 Share Posted March 7, 2006 hi i want to make a login page for the users , the users and there passwords stored in a MS-access database , so , i want to check the user name and the passwordwhich filled in html form . Link to comment Share on other sites More sharing options...
Pollux Posted March 8, 2006 Share Posted March 8, 2006 Have a read of the ADO tutorial pages. You'll need to learn how to connect to the database, and then how to query it with SQL to test whether theres and entry in the table with the username and password. If you haven't already you'll also want to look at the ASP tutorials to see how to retrieve the username and password that were entered on the form.Have a go, then if you get stuck post a question requesting help. Link to comment Share on other sites More sharing options...
Matar Posted March 9, 2006 Author Share Posted March 9, 2006 hi thank you for your replay i very well in asp and ado , i can connect the database and store data in database by html form via asp , and i can show the contant of the database on web pagi have the SQL Statment To reteve The Data for example Select* where name = 'Joe' and pass = '596' look , here i define the user name and password , i dont need this i need Checking on user name & password entered In Html form . Thank YOU. Link to comment Share on other sites More sharing options...
pulpfiction Posted March 9, 2006 Share Posted March 9, 2006 Is this what you are looking for..,ASP:<% dim uname, pwd,sqluname=request.form("login")pwd=request.form("pass")'Query to check if username and pwd vaildsql = "SELECT * FROM tblname WHERE (fldUSERNAME ='" & uname & "') AND (fldUSERNAME ='" & pwd & "')"Set RS = MyConn.Execute(SQL)if rs.EOF then'Invalid userElse'valid user...... %>HTML:<form action="test.asp" method="post"><inupt name="login"...........><inupt name="pass"...........> Link to comment Share on other sites More sharing options...
Matar Posted March 10, 2006 Author Share Posted March 10, 2006 hi thank you man for your reply i was trying the code that you write , but when i run the page , there is nothingto show in the page , the result is clear page . this the code ***********<html><body><%Dim conn Dim rs Dim strdim namedim passname = request.form("name")pass = request.form("pass")Set Conn = Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("/webdata/it.mdb"))set rs = Server.CreateObject("ADODB.recordset") sql= "SELECT * FROM samer WHERE (name ='" & uname & "') AND (pass ='" & pwd & "')" set RS = Conn.Execute(SQL)DO While NOT RS.EOF Response.Write RS("age") & "<BR>" Response.Write RS("address") & "<BR>" RS.MoveNextLoop RS.CloseSet RS = nothingConn.CloseSet Conn = nothing%></body></html>*****html code :<html><head><title>test</title></head><body bgcolor="white" text="black"> <form name="form" method="post" action="log.asp"> Name: <input type="text" name="name" > <br> Comments: <input type="password" name="pass"><br> <input type="submit" name="Submit" value="Submit"> </form> </body></html>*****i dont use ODBC Setting To Connect My Database With ASP . What Is The Problem . Link to comment Share on other sites More sharing options...
rugby Posted July 5, 2006 Share Posted July 5, 2006 try to check out your first code at line 15sql= "SELECT * FROM samer WHERE (name ='" & uname & "') AND (pass ='" & pwd & "')"what is the value for uname and pwd ? Link to comment Share on other sites More sharing options...
tjodalv Posted August 2, 2006 Share Posted August 2, 2006 Error is in that 15 line. Because he use variable pwd in his SQL command, and value of password field is stored in variable pass.Right SQL statement would be:sql= "SELECT * FROM samer WHERE (name ='" & uname & "') AND (pass ='" & pass & "')" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now