Redirect function is not working on the live server. But working on localhost
<p>This is the function. This is working in the local host. But not working in the live server.</p>

<pre><code>function redirect_to($location = NULL){
    if($location != NULL){
        header("Location: {$location}");
        exit;
    } 
}

if(mysql_affected_rows() == 1){
    //success

    redirect_to("index.php");
}
</code></pre>
