Getting a headers redirect error on line 20 and don't know why....
My code is as follows.
   <?php
    require_once("functions.php");
    $username = trim($_POST['username']);
    $password = trim($_POST['password']);
       if ($username&&$password){
    session_start();
     require_once("Connection.php");
      mysqli_select_db($db_server, $db_database) or 
                                                  die("Couldn't find db");
       $username = clean_string($db_server, $username);
       $password = clean_string($db_server, $password);  
       $query = "SELECT * FROM UserDatabase WHERE username='$username'";
        $result = mysqli_query($db_server, $query);
        if($row = mysqli_fetch_array($result)){
        $db_username = $row['username'];
        $db_password = $row['password'];
         if($username==$db_username&&($password)==$db_password){
              $_SESSION['username']=$username;
              $_SESSION['logged']="logged";
              header('Location:Log_homepage.php');
The functions page contains the following:
 <?php
 function clean_string($db_server = null, $string){ 
   $string = trim($string);  
   $string = utf8_decode($string); 
   $string = str_replace("#", "#", $string);  
   $string = str_replace("%", "%", $string);  
      if (mysqli_real_escape_string($db_server, $string)) {
        $string = mysqli_real_escape_string($db_server, $string); 
}
 if (get_magic_quotes_gpc()) {
 $string = stripslashes($string);
 }
  return htmlentities($string);
 }
         ?>
The connection page contains the following:
   <?php
  $db_hostname = 'localhost';
  $db_username = '_____'; 
  $db_password = '_______'; 
  $db_database = '_______';
  $db_server = mysqli_connect($db_hostname, $db_username,
                                         $db_password);
  if (!$db_server){
  die("MySQL connect failed: " . mysqli_connect_error());
  }else{
 mysqli_select_db($db_server, $db_database) or
   die ("Couldn't find database");
   }
    ?>
I need the the header to redirect to that page in that exact place.
Thanks!
 
    