#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    31
    Rep Power
    14
    Hi,

    I have 3 fields in my table; name, email and password. I try to find the codes for the lost password like this BBS use when you post your message.
    Can you help? Thanks!
  2. #2
  3. .Net Developer
    Devshed Novice (500 - 999 posts)

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

    just you ask the user to enter his email id then send him the password via email .


    you can try the following...

    in html page just place the following.

    <form action="forgotpwd.php3" method="post">
    <B>Your Email Address:
    <input type="text" name="email">
    <input type="submit" name="submit" value="Submit"
    </form>


    In forgotpwd.php3:

    <?php

    if($submit=="Submit"){

    $con=mysql_connect ('localhost','your username', 'your password');
    //Database connectivity
    mysql_select_db ('dbname',$con);
    //your database name ..

    $result = mysql_query ("SELECT name,email,password FROM tablename WHERE email = '$email'",$con);
    //get the name and password using this query..

    if ($row = mysql_fetch_array($result))
    {
    //the user's email-id is correct

    $msg=$row["name"].",Your password is".$row["password"];
    //create a message with username and password

    mail($email,"Your password",
    $msg);
    //mail him the message with username and password


    print "Your password has been sent your email address.Go and pick it up from their!!.";

    // show the result message..

    }else{
    //email he entered is not existing in the database..
    print "Your email address is not existing in our databasen";
    exit;
    }
    }
    ?>


    Hope this may help you....

    GOOD LUCK!!!!


    ------------------
    SR -
    shiju.dreamcenter.net

    [This message has been edited by Shiju Rajan (edited May 06, 2000).]
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    31
    Rep Power
    14
    This is exactly what I was looking for. Thank you very much for your time.

    Regards!
    Dalida
  6. #4
  7. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15



    Welcome dalida!!!!

    ------------------
    SR -
    shiju.dreamcenter.net

Similar Threads

  1. MySQL password problems NOT root
    By braveheart in forum MySQL Help
    Replies: 2
    Last Post: February 15th, 2004, 08:18 AM
  2. password generation on user auth.
    By nacho_c in forum PHP Development
    Replies: 14
    Last Post: January 16th, 2004, 04:55 AM
  3. Replies: 1
    Last Post: January 7th, 2004, 06:41 PM
  4. want password protect?
    By CaptinKirk in forum Beginner Programming
    Replies: 4
    Last Post: December 18th, 2003, 12:00 PM
  5. forget the root password... dont worry
    By fantasy in forum Linux Help
    Replies: 1
    Last Post: October 20th, 2003, 07:27 PM

IMN logo majestic logo threadwatch logo seochat tools logo