wp_signon showing error: ERROR: The password field is empty.

  • Unknown's avatar

    I’m tring to make a login form using wp_signon. It’s showing this message:

    ERROR: The password field is empty.

    I enter correct username and password. It’s in Firefox, not in Chrome, as I read that in Chrome it shows this message.
    What is this due to?

    My code is:

    <?php
    global $wpdb;
    $username=$_POST['username'];
    $password=$_POST['password'];
    $creds = array();
    $creds['user_login'] =$username ;
    $creds['user_pass'] = $password;
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
     if ( is_wp_error($user) )
     echo $user->get_error_message();
    else {
    wp_redirect('myurl here');
    }
    ?>
    <form action="" method="post"/>
        <input type="text" name="username" placeholder="Username"/>
        <input type="text" name="password" placeholder="Password"/><br>
        <input type="submit" name="submit" value="Submit">
    </form>
  • Unknown's avatar

    The site you are having issues with is a WordPress.org self-hosted site. This forum is for WordPress.com hosted sites. The correct forum for WordPress.org self-hosted sites is http://wordpress.org/support. You will need to go there and create a separate account for the support forums there.

    For more on the differences between WordPress.com and WordPress.org please see this article: https://en.support.wordpress.com/com-vs-org/

  • Unknown's avatar

    Thanks, I’ll register there.

  • The topic ‘wp_signon showing error: ERROR: The password field is empty.’ is closed to new replies.