Warning: Cannot modify header information – headers already sent by (output began at /home/content/53/7742253/html/wordpress/wordpress-content/styles/twentyten/header.php:11) in /home/content/53/7742253/html/wordpress/wordpress-includes/pluggable.php online 692,693,694

my code:-

     if(isset($_REQUEST['id']) && !is_user_logged_in())

      {

         require_once( ABSPATH . WPINC . '/registration.php' );


    $registration = get_option( 'users_can_register' );

       global $wpdb;

       $user_id = $wpdb->get_var( $wpdb->prepare("SELECT user_id FROM              

                  $wpdb->usermeta           WHERE 

                meta_key = 'id' AND meta_value =%s",$id) );

         if ( empty($user_id) ) 
              {

                 $wp_user_obj = get_user_by('email', $email);

                $user_id = $wp_user_obj->ID;

               }

               if ( $user_id)

                  {

                   wp_set_auth_cookie( $user_id );

                      wp_set_current_user( $user_id );

               if ( isset( $_REQUEST['redirect_to'] ) && !empty( 
           $_REQUEST['redirect_to'] ) ) 
            {

              wp_redirect( home_url() );

                 }
                 else 
               {

                wp_redirect(home_url() );

                 }

                   }      

                     else

                   {

                   $userdata = array();


                $user_id = wp_insert_user($userdata );

                 wp_new_user_notification($user_id,$user_pass);

                  if ( $user_id )
                     {

                         $creds = array();

                        $creds['user_login'] = $username;

                         $creds['user_password'] = $user_pass;

                          if ( !empty( $remember ) )
                            { 

                             $creds['remember'] = true;

                                 }

                    $user = wp_signon( $creds, true );  

                     update_usermeta( $user_id,'id',esc_attr( $_REQUEST['id']));

                 update_usermeta( $user_id,'fname',esc_attr( $_REQUEST['fname']));

                   update_usermeta( $user_id,'lname',$_REQUEST['lname']);

              update_usermeta( $user_id, 'email',esc_attr( $_REQUEST['email']) );

                 wp_redirect(home_url() );

               }

                }

               }    

             global $user_ID; $user = get_userdata( $user_ID );

           if(is_user_logged_in())
         {

                echo $user->user_login ; 

              } 



and heder.php line:-  `<html <?php language_attributes(); ?>>`

You are able to avoid header modification warning messages by loading your source, before it causes it to be towards the browser. If you don't get access to php.ini you can include header.php for your .htaccess or add php_value output_buffering 4096 at the very top and ob_start("ob_gzhandler"); at the end of the wordpresses root index.php

You are calling your set_cookies function past too far. At that time you refer to it as, output has began. You'll need refer to it as before any output has began, because snacks cannot be set if output has began (see too: [cde]Docs).

Inside your situation before setcookie line 11 has been performed.

That's basically before the theme get's loaded.