password functions

Results 1 to 2 of 2

Thread: password functions

  1. #1
    Join Date
    Dec 1969

    Default password functions

    im relatively new at ASP and am not sure as to what the most efficient ways to do certain thigns are. what is the best way to do login/passwords using ASP? my current method seems very inefficient, im using a text file which contains the username related password on each line, then i check what hte user enters against the string. so if the user entered user: admin pass:adminpass, my current method changes it into a string:<BR><BR>admin adminpass<BR><BR>and then reads the text file line by line until it finds a match. i would appreciate any help with this, i cant stand inefficient code =/

  2. #2
    Join Date
    Dec 1969

    Default Database.

    Put your information into a database<BR><BR>tbl_users<BR>----------------<BR>user_id Counter<BR>username text<BR>password text<BR><BR>then... You use a SQL command to find if the user entered their information correctly<BR><BR>SQL = "Select count(*), user_id from tblusers where username=&#039;" & request("username") & "&#039; and password = &#039;" & request("password") & "&#039;"<BR><BR>then use an if-then structure to see if the user was found..<BR><BR>if rs.fields(0).value &#062; 0 then<BR> response.write("logged in!")<BR> session("user_id") = rs.fields(1).value<BR>else<BR> response.write("Invalid username or password!")<BR>end if<BR><BR>-- Whol

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts