Making a downloadable file password protected on webpage
问题 I want to make a webpage which has download option for a pdf, but i want it password protected i.e. if someone clicks on that link he has to enter username and password and if he directly open the link "www.example.com/~folder_name/abc.pdf" then server ask for password first and then allow to download Edit: I want user to view the file in browser, not to force it to download here is my code <?php /* authentication script goes here*/ $file = 'http://example.com/folder_name/abc.pdf'; //header(