The file getting displayed in browser instead getting downloaded. It was working before. I made some changes to other part of my project.but I didn't touch this function, I have no idea what happened . please help me.
$filename=date("d-m-ys").".sql";
$handle = fopen($filepath."/".date("d-m-ys").".sql", 'w+');
fwrite($handle, $return);
fclose($handle);
$bits = @file_get_contents($filepath."/".date("d-m-ys").".sql");
header("Content-type: application/sql");
header('Content-Disposition: attachment; filename="'.$filename.'"');
print $bits;