See on the second line below where it says sql? This script will force a download, and propose the name of the file. However, if I change the sql to pdf, without changing anything else, it no longer forces a download, but instead displays the pdf.
IS THERE ANY WAY TO STOP THIS???????
Here is the code I'm using:
BTW I got it from phpMyAdmin.
header('Content-Type: application/octetstream');
header('Content-Disposition: inline; filename="' . $filename . '.' . sql . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Disposition: attachment; filename="' . $filename . '.' . $ext . '"');
header('Expires: 0');
header('Pragma: no-cache');
readfile($filename);