Topic: PHP Download Form

Hey,

Ive just made a E-Book Download forum and I need a secure way of downloading a file, so the user cannot directly download it by using a link, instead they have to be logged and use a form which I have made to download the file.

I know this can be done because ive done it about 2 - 3 years ago now, but forgen how to do it.

Any ideas or links to help sites would be great.

Thanks in advance

2 (edited by MadHatter 2006-07-07 04:30)

Re: PHP Download Form

place the files in a folder and add a deny all rule to its .htaccess file.  from your website, the user selects the file they want to download.  you store the path to that file.  add the content type to the header: header("Content-type: ..."); and then readfile("path_to_file");  that will send it to the user.

Re: PHP Download Form

Thanks i figured it out