md5 crypting in vbulletin

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abdoelmasry
    New Member
    • Oct 2006
    • 104

    md5 crypting in vbulletin

    Hi men
    im trying to develop script for vbulletin

    i will ask the user to enter his password im forum

    i should validate password from database

    i know that vbulletin use md5() to crypt passwords but
    i need to know it do that

    ex:

    i tryed to check the password 123456 but this way:


    [PHP]$gtdata=mysql_q uery("select password from user where username='abdoe lmasry'");
    $cdata=mysql_fe tch_row($gtdata );

    if(md5($cdata[0])=="123456"){
    echo "Ok Go";
    }
    else{
    echo "Invalid Password";
    }[/PHP]
    im sure that the password is 123456

    why i cann't check it by md5() ??
  • johnhjohn
    New Member
    • Dec 2006
    • 43

    #2
    I am not sure what you are asking, but let me try to help. If vbulletin has the password stored as an md5, then you will want to check the password by creating the md5 of the password you are checking. So I would try:

    [PHP]$gtdata=mysql_q uery("select password from user where username='abdoe lmasry'");
    $cdata=mysql_fe tch_row($gtdata );

    if($cdata[0]==md5("123456") ){
    echo "Ok Go";
    }
    else{
    echo "Invalid Password";
    }[/PHP]

    Comment

    • abdoelmasry
      New Member
      • Oct 2006
      • 104

      #3
      hi johnhjohn

      i got it

      vbulletin use this way to code userpasswords

      [PHP]$md5_password=m d5(md5('123456' ).$user['salt']);[/PHP]

      Abdo Elmasry

      Comment

      Working...