使用header()不会触发页面上的include

I'm having some trouble when I header to my user page through a login script.

I have a file called top_template.php that includes all the information for the top of the page when I navigate to it, this also includes the php code that puts the title in the browser window as well as the jquery that highlights the active menu, the problem I have however is that when I use header from my login script, none of this stuff carries on through to the user page. The javascript doesn't trigger and set the profile menu item to active, nor does the title input properly.

However if I click on the menu item it all kicks into action and start working again, just not when I use php's header("location:");

End part of login script:

header("location:user/user?user=".$db_username."");

Top of Template.php file:

<head>
<link rel="stylesheet" href="../style/top_template_STYLE.css">
<link rel="stylesheet" href="../style/style.css">
<link href="../favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link rel="stylesheet" href="../style/bjqs.css">

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="/includes/js/highlightNav.js"></script>

<link href='http://fonts.googleapis.com/css?family=Noto+Sans|Francois+One' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>

<script src="../includes/js/bjqs-1.3.min.js"></script>

<?php
include_once("../analyticstracking.php");
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$pathFragments = explode('/', $path);
$end = end($pathFragments);
$end = ucfirst ($end);
$end = str_replace("-"," ", $end);
switch($end){
    case "User":
        $end = "Profile";
        break;
    default:
        break;
}
echo '<title>'.$end." - mysite.com</title>";
?>

As you can see, at the top of the Template.php file all of the neccessary stuff is in there, except none of it triggers. My highlightNav.js script will only trigger on document load too, so I have no idea why it wouldn't work.

I have also tried using

    echo "
    <script>
    window.location.href = 'user/user?user=".$db_username."'
    </script>";

In place of header but to no avail. any input is appreciated!