Confirm Password and e-mail

Discussion in 'PHP' started by masterofzoo, Sep 2, 2011.

  1. #1
    Hi everyone, Hope that question is easy and get help from this forum


    I am working on my website using dream weaver, I wanna insert a textfield "confirm password" and another one "confirm e-mail", the cahrachter entered in these fields should equal to the password and email respectively,:-

    1- should these confirmatory fields represented in the database?
    2-what code should be used in order to do this.............thx
     
    masterofzoo, Sep 2, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    1. No. You have the password and the email in the database - which is on the server. You verify the confirmation fields in the browser. The server never sees them.

    2. Just make sure that the value of the two fields (the normal one and the confirmation one) are equal.

    if(document.getElementById('password').value <> document.getElementById('verifyPassword').value) {
    alert('The password and verify password entries don't match.');
    return false;
    }
    //other code to check other fields before submitting the form
    //if everything is okay, submit the form
     
    Rukbat, Sep 2, 2011 IP
  3. digitalpoint.futureistic

    digitalpoint.futureistic Guest

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #3
    Hi,

    You might use this code.
    if ($password<>$cnfrmpassword)

    Thanking You,
    Futureistic Team.