help me please. i am making a login page..

Reply

Join Date: Feb 2007
Posts: 53
Reputation: Hellodear is an unknown quantity at this point 
Solved Threads: 0
Hellodear's Avatar
Hellodear Hellodear is offline Offline
Junior Poster in Training

help me please. i am making a login page..

 
0
  #1
Jun 9th, 2007
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.....
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 4
Reputation: bsvnhll is an unknown quantity at this point 
Solved Threads: 0
bsvnhll bsvnhll is offline Offline
Newbie Poster

Re: help me please. i am making a login page..

 
0
  #2
Oct 10th, 2007
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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 50
Reputation: david_123 is an unknown quantity at this point 
Solved Threads: 0
david_123 david_123 is offline Offline
Junior Poster in Training

Re: help me please. i am making a login page..

 
0
  #3
Nov 7th, 2007
If it is new user he must go to registeration page as well to store his or her information

thanks
www.globalsoftsols.com




Originally Posted by bsvnhll View Post
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,080
Reputation: SheSaidImaPregy is an unknown quantity at this point 
Solved Threads: 68
SheSaidImaPregy SheSaidImaPregy is offline Offline
Veteran Poster

Re: help me please. i am making a login page..

 
0
  #4
Nov 8th, 2007
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:
  1. <%
  2. Response.Buffer = true
  3. Session("DatabasePath") = "Path to your database, put it here. rest will fill in for you"
  4. If Request.Form("btnLogin") = "Login" AND Request.Form("txtUserName") <> "" AND Request.Form("txtPassword") <> "" Then
  5.  
  6. Dim conn, strSQL, rs
  7.  
  8. strUserName = MakeSQLSafe(Trim(Request.Form("txtName")))
  9. strPassword = MakeSQLSafe(Trim(Request.Form("txtPassword")))
  10.  
  11. Set conn = Server.CreateObject("ADODB.Connection")
  12. conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Session("DatabasePath") & ";"
  13.  
  14. strSQL = "SELECT UserName, UserID FROM Users WHERE UserName='" & strUserName & "' AND UserPassword='" & strPassword & "'"
  15.  
  16. Set rs = Server.CreateObject("ADODB.Recordset")
  17. rs.Open strSQL, , 0, 2
  18.  
  19. If Not rs.EOF Then
  20. Session("logged") = 1
  21. Session("UserName") = rs("UserName")
  22. Session("UserID") = rs("UserID")
  23. Else
  24. Response.Redirect ("register.asp?login=failed")
  25. End If
  26. rs.Close()
  27. conn.Close()
  28. set rs = nothing
  29. set conn = nothing
  30. Else
  31. response.redirect ("login.asp?fields=null")
  32. End If
  33.  
  34. Function MakeSQLSafe(sender)
  35. sender = Replace(sender, ";", "")
  36. sender = Replace(sender, """", "")
  37. sender = Replace(sender, "'", "")
  38. sender = Replace(sender, "''", "")
  39. Return(sender)
  40. End Function
  41. %>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC