User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 402,689 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,427 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 840 | Replies: 1 | Solved
Join Date: Mar 2007
Posts: 13
Reputation: roby4eldiablo is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
roby4eldiablo roby4eldiablo is offline Offline
Newbie Poster

Login and check password from Database

  #1  
Apr 30th, 2008
Hi all. I have a login Form where user can insert Nickname & Password.
I have a database where i have listed new registered user and store their information.
The problem is when I control the Form data "pass" and check if it's equal to the rst("pwd")
into the database.
It never match....
The 2 password are equal but it look like if they are different.
Someone can help me please?

  1. var con;
  2. var conString;
  3. con = Server.CreateObject("ADODB.Connection");
  4. conString = "Provider=Microsoft.Jet.OLEDB.4.0; "+ "Data Source= " + Server.MapPath("/negozio.mdb");
  5. con.Open(conString);
  6. var n, p, q;
  7. n=Request.Form("nick");
  8. p=Request.Form("pass");
  9. var sSQLString;
  10. var rst;
  11. rst = Server.CreateObject("ADODB.Recordset");
  12. sSQLString = "SELECT pwd FROM utenti WHERE nick='"+n+"';";
  13. rst = con.Execute(sSQLString);
  14. q=rst("pwd");
  15. if (p != q)
  16. {Response.write ("Password errata, reinserire la password corretta");
  17. Response.AddHeader ("Refresh", "5;URL=login.asp");
  18. con.Close( );
  19. con = null;
  20. }
  21. else {Response.write ("Salve " + n + " benvenuto, tra un attimo potra accedere alle opzioni del sito");
  22. Response.AddHeader ("Refresh", "5;URL=home.asp");
  23. con.Close( );
  24. con = null;
  25. }
Last edited by roby4eldiablo : Apr 30th, 2008 at 9:51 am.
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 5:17 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC