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 427,205 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,165 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

Login and check password from Database

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

Re: Login and check password from Database

  #2  
May 2nd, 2008
I modify the sql string and the condition and all work properly.
I hope that someone can benefit from this article.


  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;
  7. n=Request.Form("nick");
  8. p=Request.Form("pass");
  9. var sSQLString;
  10. Response.write (" "+n+"</br>");
  11. Response.write (" "+p+"</br>");
  12. var rst;
  13. var sSQLString;
  14. rst = Server.CreateObject("ADODB.Recordset");
  15. sSQLString = "SELECT * FROM utenti WHERE nick='"+n+"' AND pwd='"+p+"';";
  16. Response.write (" "+sSQLString+"</br>");
  17. rst = con.Execute(sSQLString);
  18. if(rst.EOF)
  19. {Response.write ("Password errata, reinserire la password corretta");
  20. Response.AddHeader ("Refresh", "5;URL=login.asp");
  21. con.Close( );
  22. con = null;
  23. }
  24. else {Response.write ("Salve " + n + " benvenuto, tra un attimo potra accedere alle opzioni del sito");
  25. Response.AddHeader ("Refresh", "5;URL=home.asp");
  26. con.Close( );
  27. con = null;
  28. }
Reply With Quote  
All times are GMT -4. The time now is 10:56 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC