title: Warning: session_start(): Cannot start session when headers already sent
body: <p>i have error on line 58 if(isset($_SESSION['username'])){ 
  , when i tried on xampp localhost its work and no error but when i hosting to the 000webhosting, its have so many errors</p>
  
  <p>Warning: session_start(): Cannot start session when headers already sent in /storage/ssd4/858/9397858/public_html/atasan.php on line 58
  <a href="https://i.stack.imgur.com/hLswO.png" rel="nofollow noreferrer">enter image description here</a></p>
  
  <p>file php here:</p>
  
  <blockquote>
    <p>Deleted link full of crap was here.</p>
  </blockquote>
  
  <p>link hosting:
  <a href="https://ayojalankuy.000webhostapp.com/" rel="nofollow noreferrer">https://ayojalankuy.000webhostapp.com/</a></p>
  
  <pre><code>    &lt;?php session_start();
  
  if(isset($_SESSION['username'])){
  ?&gt;
              &lt;span class="element-divider place-right"&gt;&lt;/span&gt;
              &lt;div class="element place-right"&gt;                   
                  &lt;a class="dropdown-toggle icon-cog" href="#"&gt;&lt;/a&gt;
                  &lt;ul class="dropdown-menu" data-role="dropdown"&gt;
                      &lt;li&gt;&lt;a href="profil.php"&gt;Profil&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="booking.php"&gt;Booking&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="bookingList.php"&gt;Cek Booking&lt;/a&gt;&lt;/li&gt;
                      &lt;li class="divider"&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="logout.php"&gt;Keluar&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
              &lt;a href="profil.php" class="element place-right"&gt;Selamat datang, &lt;?php echo "$_SESSION[username]"; ?&gt;&lt;/a&gt;
  </code></pre>