Download File (PHP)
By | Thursday, December 1, 2011


Hide Comments




PHP:
<?php

header("Content-type: text/plain"); //SHOWS TEXT "AS IS"
//MAKE SURE FILE EXTENSIONS ARE THE SAME
header("Content-Disposition: attachment; filename=script.html"); //FILENAME TO BE SAVED AS
readfile("http://example.com/yourfile.html"); //SERVER FILENAME

?>