When you click some files like .rar, .zip, .doc, etc, it will be automatically downloaded. But for the files like .htm, .php, etc, when you click it, it will be parsed in the browser. I'm now developing a file manager by php, and want to download the php, html files in browser. Just as some file manager did, when you select a file and click download button, the file will be downloaded to your computer. How do we do that by php? And do we need to change any configurations of the apache server?
What about force download using another file? You need to create a new file (eg : download.php) Pass variable to the file like download.php?file=the_php_file.php Think about security though.