JS Won't Redirect : <p>I have this code that I have made and have been trying to fix it for days. I am trying to make it redirect to whatever the $link variable is set to. All it does is just give me a blank page. Any answers?</p>

<pre><code>&lt;?php 
$l = $_GET['l'];
$db = new mysqli('localhost', 'root', 'password', 'link');
$sql = "SELECT * FROM links WHERE new_url='$l'";
$result = $db-&gt;query($sql);
if($result-&gt;num_rows &gt; 0) {
    $row = $result-&gt;fetch_assoc();
    $link = $row['website'];
    $string = $row['new_url'];
    echo '&lt;script type="text/javascript"&gt;',
         'window.location = $link;',
         '&lt;/script&gt;';
} else {
    @include('./error.php');
}
?&gt;
</code></pre>
