Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
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"

share|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
add comment

1 Answer 1

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');

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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