title: Login function not working, header function broken?
body: <p>Here's the deal, my function stopped working all of the sudden, probably due to the hosting changing something, I honestly don't know why but only on this <em>login.php</em> the header function doesn't work at all, and all used to work perfectly, and I was logging in, out, doing sessions etc.</p>
  
  <pre><code>&lt;?php 
          if($_SESSION['username']){
  
          header('Location: http://xshooter.hol.es/index.php');
          exit();
          }
  
          if($_POST['submittedLogin']==1){
  
              $pass=md5($_POST['loginPassword']);
              $db=Mysql_connect ("mysql.hostinger.hr","u386117026_admin","");
              mysql_select_db ("u386117026_db");
  
              $sql="SELECT * FROM u386117026_db.user WHERE username='" . $_POST['loginUsername'] . "' AND password='" . $pass . "'";
              $result=mysql_query($sql);
  
              if($result){
              while($row = mysql_fetch_array($result)){
  
              if(($row['username']==$_POST['loginUsername'])&amp;&amp;($row['password']==$pass)){
              session_start();
              $_SESSION['username']=$_POST['loginUsername'];
              $_SESSION['user_id']=$row['user_id'];
              $_SESSION['admin']=$row['admin'];
  
  
              header("Location: http://xshooter.hol.es/index.php");
              exit();
              }else{
  
              header("Location: http://xshooter.hol.es/index.php?loginfail=1");
              exit;
              }
              }
  
              }
          }
          ?&gt;
  </code></pre>