Hello i was wondering if there is any way to stop people accessing a pdf file/or a directory containing the files directly but allow them to access it via a link on apache. The reason is i only allow people to view a certain number of pdfs but if they access the pdf directly there visit is not logged in my database as they should go in via another page which logs there visit I cant deny from all in .htaccess but is there a way you can use .htaccess to allow from a certain referrer or if a post variable is set. If not is there another way? thanks, lewis
Well, there's probably more than one way to work on this, but I would just put the pdf in my db, so they can only access it via a link. Seems like the easiest way to control it.
Thanks for the reply, do you mean store as binary is sql db. iswww.php-mysql-tutorial.com/wikis/mysql-tutorials/uploading-files-to-mysql-database.aspx what your talking about? sorry cant post link havnt been a member long enough I also cant imagine that my free host will allow huge databases, but there are only about 4-5 pdfs about 130-180kb so it should be alright
arite cheers i try and get it setup. ive never really used mysql and binary before so it will just be experimenting...
I have tried this upload method but the query is to long an splits. I believe there is some way to split the binary intoan array so th query is not to long. I can upload html files fine but pdf's are too large
Another way to do it is to set folder permissions (with an FTP program) so that only the server can access the files and then make a script to call the file.