I have a form that works (input data is transferred to Mysql database and redirects back to index.php) in my XAMP local sever but when I copy the files and code to my online hosting my data is uploaded to the database but the program is failing to redirect. Please have a look at my redirect code and let me know of any possible solutions.
// Insert
public function insert($query) {
    $insert_row = $this->link->query($query) or die($this->link->error.__LINE__);
    //Validate Insert
    if($insert_row) {
        header("Location: index.php?msg=".urlencode('Record Added'));
        exit();
    } else {
        die ('Error : ('.$this->link->error.') '.$this->link->error);
    }
}
* This is just my insert function, with a redirect if insert is successful.
 
    