if ( !empty($_POST['pass1'] ) && !empty( $_POST['pass2'] ) ) {
            if ( $_POST['pass1'] == $_POST['pass2'] )

    wp_update_user( array( 'ID' => $current_user->id, 'user_pass' => esc_attr( $_POST['pass1'] ) ) );

            else
            $error = __('The passwords you entered do not match.  Your password was not updated.', 'frontendprofile');
    }

I have used the above code to change users password but the error was occured

"Warning: Cannot modify header information - headers already sent by (output started at /hermes/web02/b1441/moo.sharerecipesnowcom/sharerecipesnownet/wp-content/themes/recipe/header.php:13) in /hermes/web02/b1441/moo.sharerecipesnowcom/sharerecipesnownet/wp-includes/pluggable.php on line 720"

link|improve this question
I can't see anything in the above code that would cause that particular error(i could be wrong), what's in the theme's header.php on line 13? – t31os Jul 26 '11 at 15:40
feedback

1 Answer

the problem is with your cookies.wp_update_user function is trying to change them after all headers were sent, try to use such code like that: function my_func(){ // your code } add_action('init','my_func');

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.