• Resolved haxxxton

    (@haxxxton)


    Hey guys,

    I have created a new sign up form as i need it to be a lot more complex than the standard wordpress sign up or even what register plus etc can provide. The problem I am having is when writing the password to the database.

    currently i am using
    $password = wp_hash_password($_POST['user_password']);

    and then inserting that into the database in the password section of the wp_users database.. however that password then doesnt work when you go to login with it…

    oddly enough when i refresh the page using
    echo wp_hash_password('test');
    i get a different hash displaying everytime..

    As I am using buddy press and the wordpress function reference says that the $wp_hasher information can be overwritten by plugins and i am assuming that is what is happening.

    Please help! i am trying to get this registration form up and running asap.

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Thread Starter haxxxton

    (@haxxxton)

    managed to fix this issue by writing the following
    $wpdb->query($wpdb->prepare("INSERT INTOwp_users(user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_status, display_name) values ('$user_login', MD5('$user_pass'), '$user_nicename', '$user_email', '$user_url', '$date_registered', '$user_status', '$user_display_name')"));

    note the MD5() around the $user_pass variable.. this appropriately hashes the password as it is entered into the database.

    just FYI

Viewing 1 replies (of 1 total)
  • The topic ‘writing password to database’ is closed to new replies.