#1
  1. No Profile Picture
    chinnavi
    Guest
    Devshed Newbie (0 - 499 posts)

    i need help in getting nice Login in checking the Login name and password Check Script ?.
    The Script has to do the following things ...

    i have a form for login name and password ...
    the script has to check whether the login name exists and then check for password ..

    I already wrote the script and i need some help from genius persons to help me in getting better script.

    I adopted following logic.

    1. Get the Login AND password from Form.
    2. Check For Login Whether Exists.
    3. If Login Exists Check for Password correct or not ?
    4.If NOLOGIN --->Throw Form again with error?
    5.If Password ERROR --->Thro the Same Form with Error.

    Anybody with better logic and performance please do help me to upgrade the logic.

    vijay
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15
    Vijay,

    Here is a very small suggestion from me..

    here is my suggestion:

    1. Get the Login AND password from Form.
    2. Check For Login and Password Whether Exists.
    3.If both are not matching ...Thro the Same Form with Error "Login Failed"...

    -----
    that is the straight and easy way..




    ------------------
    SR -
    webshiju.com

    "The fear of the LORD is the beginning of knowledge..."
  4. #3
  5. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Anybody with better logic and performance please do help me to upgrade the logic.

    Your logic seems great. However, you seem to be using clear-text password. So are there any database involved? Or htaccess?

    If htaccess, you need not to worry about the authentication for login at all. For registration, you probably do need to following logic..

    1) Get username from Form
    2) Check username existence
    3) If exists, send a "last" so it save some time reading thru the entire username record
    4) If not exist, continue the other process
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    1
    Rep Power
    0
    If you're using a db such as mySQL, then u have to pay attention to how you set up your db... I went thru the same problem about a week ago, and it turned out my php3 scripting was correct, only I'd mis-setup my db.

    ------------------

    Yosun Chang
    CEO NuSoy netMages
    www.nusoy.com
  8. #5
  9. No Profile Picture
    chinnavi
    Guest
    Devshed Newbie (0 - 499 posts)
    i m using mysql and perl dbi ...
    ---->
    ChinnaVi $ mysql -V
    mysql Ver 9.36 Distrib 3.22.27, for pc-linux-gnu (i686)
    ChinnaVi $
    ---->

    i didnt face any problem setting up the db ..
    Can you please tell me your problem so that i will check i have any problem in my script .

    I wanna store as encrypted user name and password in mysql ... any body is having any idea about encryption?

    vijay
  10. #6
  11. No Profile Picture
    ledjon
    Guest
    Devshed Newbie (0 - 499 posts)
    I'm not into mysql/perl stuff.. I use php with mysql. But as far as the encryption goes:

    #######
    crypt("$password", xx)
    #######

    $password is the plain text you want encrypted. "xx" is a 2 letter key that it used as encryption keys. They can be any two letters. If you want to set it to a variable to put into the database just use:
    #######
    $var = ("$password", xx);
    #######
    If you then need to compare an input password the one in the database you have to do it like this (since you can't decrypt a password):

    #######
    if (crypt("$INPUT{password}", xx) eq $database_password) {&blah} else {&blahblah}
    #######

    That should all work fine.

IMN logo majestic logo threadwatch logo seochat tools logo