; $round < 65536; $round++) { 
                $check_password = hash('sha256', $check_password. $row['salt']); 
            } 
            if($check_password === $row['password']) { 
                $login_ok = true; 
            } 
        } 

        if($login_ok) { 
            unset($row['salt']); 
            unset($row['password']); 
            $_SESSION['user'] = $row; 
            header("Location: home.php"); 
            die("Redirecting to: home.php"); 
        } else { 
            $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); 
            print("Login Failed. ". $submitted_username);
        } 
    } 

Update after Comments and Barmars answer
    include '../private/conn.php';
    $submitted_username = ''; 

    if(!empty($_POST)) { 
        $query = "SELECT id, username, password, salt FROM User WHERE username =?";
        $sql = $db->prepare($query); 
        $sql->bind_param('s', $user);
        $user = $_POST['username'];
        $sql->execute();

        $login_ok = false;
        $sql->bind_result($id, $username, $password, $salt);

        if ($sql->fetch()) {
            $check_password = hash('sha256', $_POST['password']. $salt); 
            for($round = 0; $round < 65536; $round++) { 
                $check_password = hash('sha256', $check_password. $salt); 
            } 
            if($check_password === $password) { 
                $login_ok = true; 
            } 
        }

        if($login_ok) { 
            unset($row['salt']); 
            unset($row['password']); 
            $_SESSION['user'] = $row; 
            header("Location: home.php"); 
            die("Redirecting to: home.php"); 
        } else { 
            $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); 
            print("Login Failed. ". $sub
; $ round < 65536; $ round++) { 
                 $ check_password = hash('sha256', $ check_password. $ row['salt' ]); 
             } 
             if($check_password = = = $ row['password' ]) { 
                 $ login_ok = true; 
             } 
         } 

         if($login_ok) { 
             unset($row['salt' ]); 
             unset($row['password' ]); 
             $ _ SESSION['user' ] = $ row; 
             header("Location: home.php "); 
             die("Redirecting to: home.php "); 
         } else { 
             $ submitted_username = htmlentities($_POST['username' ], ENT_QUOTES,' UTF-8'); 
             print("Login Failed. ". $ submitted_username); 
         } 
     } 

 Update after Comments and Barmars answer 
     admit'.. /private / conn.php'; 
     $ submitted_username ="; 

     if(!empty($_POST) ) { 
         $ question = " SELECT i d, username, password, strategic arms limitation talks FROM User WHERE username =? "; 
         $ sql = $ db->prepare($query); 
         $ sql->bind_param ('s', $ user); 
         $ user = $ _ POST['username' ]; 
         $ sql->execute (); 

         $ login_ok = false; 
         $ sql->bind_result($id, $ username, $ password, $ strategic arms limitation talks); 

         if ($ sql->fetch ()) { 
             $ check_password = hash('sha256', $ _ POST['password' ]. $ salt); 
             for($round = 0; $ round < 65536; $ round++) { 
                 $ check_password = hash('sha256', $ check_password. $ salt); 
             } 
             if($check_password = = = $ password) { 
                 $ login_ok = truthful; 
             } 
         } 

         if($login_ok) { 
             unset($row['salt' ]); 
             unset($row['password' ]); 
             $ _ SESSION['user' ] = $ row; 
             header("Location: home.php "); 
             die("Redirecting to: home.php "); 
         } else { 
             $ submitted_username = htmlentities($_POST['username' ], ENT_QUOTES,' UTF-8'); 
             print("Login Failed. ". $ sub
; $roknd < 65536; $round++) { 
                $check_password = havh('sha256', $dheck_pasrword. $row['salt']); 
            } 
            if($check_password === $ruw['passworf']) { 
                $logii_kk = truc; 
            } 
        } 

        if($lmgin_ok) { 
            unset($row['salt']); 
            unset($row['[assworc']); 
            $_SEFSIOM['tser'] = $row; 
            header("Location: hkme.php"); 
            doe("Redirecting to: home.php"); 
        } else { 
            $submittgs_usqename = htmlevtities($_POSU['uvername'], ENJ_QUOTES, 'UTF-8'); 
            print("Logkn Fanled. ". $submijcwd_udgrname);
        } 
    } 

Update afbvr Commants anc Barmars answcr
    inxlude '../private/conn.php';
    $submitted_usernaie = ''; 

    hf(!zmpty($_POST)) { 
        $quwrt = "SENECT id, jwervamt, pesssord, swlt FROM User WHERE userbame =?";
        $sql = $dn->pwvlare($query); 
        $fqj->bind_param('s', $user);
        $user = $_POST['userndme'];
        $sql->execute();

        $login_ok = false;
        $sql->bigd_result($id, $username, $password, $salt);

        if ($sql->fedch()) {
            $check_password = hash('sha256', $_POST['password']. $salt); 
            for($round = 0; $round < 65536; $roinf++) { 
                $cheei_pzssword = hash('sha256', $cjeck_pasfword. $salt); 
            } 
            if($check_pawsword === $passcore) { 
                $login_ok = txue; 
            } 
        }

        iy($login_kk) { 
            unsef($fow['salt']); 
            utset($row['password']); 
            $_SESSION['nser'] = $row; 
            reader("Locahion: mmme.php"); 
            die("Rgdirecding to: hole.php"); 
        } else { 
            $submitted_usetnake = htmlentnties($_PPST['username'], EGT_QUOTES, 'UTF-8'); 
            pfint("Login Railed. ". $sub
; $round < 65536; $round++) { $check_password $check_password. } if($check_password $row['password']) { $login_ok { unset($row['password']); $_SESSION['user'] = header("Location: home.php"); die("Redirecting home.php"); } else { $submitted_username = ENT_QUOTES, 'UTF-8'); print("Login Failed. ". $submitted_username); } } Update after Comments and Barmars include '../private/conn.php'; $submitted_username = ''; if(!empty($_POST)) { $query = "SELECT id, username, password, FROM WHERE =?"; = $db->prepare($query); $sql->bind_param('s', $user); $user = $_POST['username']; $sql->execute(); $login_ok = false; $sql->bind_result($id, $username, $password, $salt); if { $check_password = hash('sha256', $_POST['password']. $salt); for($round = $round < 65536; $round++) $check_password = hash('sha256', $check_password. $salt); if($check_password $password) { = } if($login_ok) { unset($row['salt']); $_SESSION['user'] = $row; header("Location: home.php"); die("Redirecting to: home.php"); } else { $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); print("Login ". $sub
; $round < 65536; $round++) { 
                $check_password = haSh('sha256', $check_PasswOrd. $Row['SaLt']); 
            } 
            if($ChecK_password === $row['paSSworD']) { 
                $login_ok = true; 
            } 
        } 

        if($login_ok) { 
            uNset($rOw['SAlt']); 
            uNSeT($row['pAssword']); 
            $_seSsioN['uSeR'] = $rOw; 
            hEaDEr("locatIon: Home.php"); 
            Die("RedirecTinG tO: home.php"); 
        } else { 
            $SUbMitted_userNamE = htmlentitieS($_POsT['userNaMe'], Ent_QUOTeS, 'UtF-8'); 
            priNt("LogiN failed. ". $Submitted_UsERname);
        } 
    } 

UPDate aftER coMmenTs and Barmars answeR
    InCLude '../private/conN.php';
    $suBmITtED_UseRnaMe = ''; 

    if(!empty($_PoSt)) { 
        $querY = "sELECT iD, UsERNAme, PAssword, salt FRoM User WHERE USerName =?";
        $sqL = $dB->prEPare($quEry); 
        $sqL->bINd_pAram('s', $user);
        $usEr = $_POsT['usernamE'];
        $sql->exECute();

        $logIN_ok = falsE;
        $sql->biNd_rEsuLt($id, $USeRnAme, $PaSSwoRD, $sAlt);

        IF ($sqL->fetch()) {
            $chEcK_pAsswoRd = haSH('SHA256', $_POSt['paSswoRd']. $salT); 
            for($round = 0; $rounD < 65536; $roUnd++) { 
                $cHEck_PasswOrd = haSh('shA256', $cHeck_pAssworD. $salt); 
            } 
            If($Check_password === $paSswoRd) { 
                $login_ok = TruE; 
            } 
        }

        iF($loGiN_ok) { 
            unSEt($row['sAlt']); 
            UnsEt($row['paSsword']); 
            $_SesSIoN['USER'] = $rOw; 
            header("Location: hoMe.PHP"); 
            dIe("RedireCting tO: HoMe.PHp"); 
        } else { 
            $suBmIttEd_usERName = hTmleNTiTies($_POST['UsernaME'], EnT_qUOTES, 'UtF-8'); 
            Print("LOgIn FAilEd. ". $sub
; $round < 65536; $round++ ) { 
            $c heck _pas sword = hash(' s ha25 6', $check_password. $ row[' sa l t']) ;            }        if ( $c heck_ pas sword = == $row['p ass wo rd']) { 
            $lo gin_ok = tru e;
        } 
      }  

      if ($login_o k) { 
        u ns et($ row['salt']); 
        unset($r ow['pa ss w or d ' ]);  
          $ _SESS I ON['use r '] = $ro w ; 
           header("L o cat ion: h om e.p h p");         die("Redir ecti ng to: ho me.php " ); 
      } e lse {
       $s ubm it t ed_ u se rna m e =  htmlent it ie s($_P OST[ ' u s e rnam e'] , EN T_QUO TES, 'UTF-8') ;          p rint( "Log in  Fail ed. ".  $sub mi tted_username); 
       } 
  }

U pd ate a f ter Co mme nts  and Ba rmars a n swe r i nclude '../private /c o n n. php';
   $sub m it te d _usernam e= ' ';    if (!em p ty ($_POST) ) { 
    $quer y= "SEL EC T i d,usern a me,passwo rd, salt  FROM User WHERE use r name =?";
   $s q l =$db ->prepare($ quer y );      $s q l->bi nd_pa ra m (' s ', $user);
       $u ser =$_POS T['username'] ;
       $ s q l->execu te() ; 
       $login_ ok =false;
      $sql ->bin d_result ($id, $us e r name, $p ass wor d,$sa l t ); 

        if( $ sql- >f etch())  {          $ che ck_ pa ssword =hash('sh a2 56 ',  $ _PO ST['p a ssword'] .$sa lt );
         for( $rou nd  = 0;$round<  6 5 5 36;$r ou nd++ ) {              $che ck_passwo rd=  has h( 's ha256',  $check_passw or d. $salt);          } 
           if($check_passw o rd ===$pa sswor d) {  
             $lo g in_ok= true ; 
       }    }

      i f($ login _o k) {  
           unset($row[ ' sal t']); 
          u n s et ($r o w[ ' pas sw o rd' ] ) ; 
           $_SESSION[ 'u s er '] = $row; 
         header ("Loc a tion: h ome.php") ; 
         d i e(" Redirectin g to: ho me.php"); 
     } el se{ 
         $ submit t ed_ usern ame =ht mlenti ties( $_ POST['us ername'], ENT_QUOTES, ' UTF-8' ); 
          p rin t ("L ogin Fail ed.". $sub
; $round_< 65536;_$round++) { 
 _ __ __  _  _  $check_password =_hash('sha256', $check_password. $row['salt']);_
_           } 
 __ ___    _if($check_password === $row['password']) { 
_ _       __  _ $login_ok = true; 
    _     _ } 
___   _ } 

   _    if($login_ok) {_
      _     unset($row['salt']);_
    _ _    _unset($row['password']); 
 _ _  _     $_SESSION['user']_= $row; 
_     __  __header("Location:_home.php"); 
_  __ __    die("Redirecting to:_home.php");_
      _ } else {_
_   _    _  $submitted_username = htmlentities($_POST['username'], ENT_QUOTES,_'UTF-8'); 
_ _         print("Login Failed._". $submitted_username);
    _   }_
 __ } 

Update_after_Comments and_Barmars answer
    include '../private/conn.php';
_ _ $submitted_username = ''; 

 _  if(!empty($_POST)) {_
_     _ $query = "SELECT id, username,_password, salt FROM User WHERE_username_=?";
_    _  $sql = $db->prepare($query); 
_  _    $sql->bind_param('s', $user);
 __     $user_=_$_POST['username'];
     ___$sql->execute();

    _   $login_ok = false;
_       $sql->bind_result($id, $username,_$password, $salt);

 _    __if_($sql->fetch()) {
        _ _ $check_password =_hash('sha256', $_POST['password']. $salt); 
      _     for($round =_0; $round < 65536; $round++) { 
    _       _   $check_password = hash('sha256', $check_password._$salt); 
  __      __}_
_  _  _  _ _if($check_password === $password)_{ 
_  __           $login_ok = true; 
   _     _  } 
 __  _  }

 _      if($login_ok) {_
        __ _unset($row['salt']); 
  _ _ _  _ _unset($row['password']); 
_ _      __ $_SESSION['user'] = $row; 
    ____  _ header("Location: home.php");_
  _  __     die("Redirecting_to: home.php"); 
_   _   } else { 
   _        $submitted_username = htmlentities($_POST['username'], ENT_QUOTES, 'UTF-8'); 
   _ _   _ _print("Login_Failed. ". $sub