允许用户下载.html和.css文件而不强制他们右键单击,另存为

I want to allow a user to download an html file using a php script.

I know this is possible with image files, but does is it possible with html/css files and if not how can i zip the files or something and then allow the user to download the zip?

They will only have access to the .html file via the php script. The file will be password protected.

It is possible, you just have to mess with the PHP headers.

header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=\"filenamehere.html\");  

you will have to get the file and pass it through the PHP script.