RE: [PHP-DB] File Downloads

2010-05-28 Thread Adam Schroeder
Hi Karl -- You can store the file contents outside of the web tree and use PHP to "read" the contents. This allows you to place access control restrictions in the PHP script. This post talks about doing something similar with images. Obviously, if you have a music track... you'll need to adj

Re: [PHP-DB] File Downloads

2010-05-28 Thread Karl DeSaulniers
On May 28, 2010, at 4:18 PM, Adam Schroeder wrote: Hi Karl -- You can store the file contents outside of the web tree and use PHP to "read" the contents. This allows you to place access control restrictions in the PHP script. This post talks about doing something similar with images.

Re: [PHP-DB] File Downloads

2010-05-28 Thread Karl DeSaulniers
On May 28, 2010, at 4:33 PM, Karl DeSaulniers wrote: On May 28, 2010, at 4:18 PM, Adam Schroeder wrote: Hi Karl -- You can store the file contents outside of the web tree and use PHP to "read" the contents. This allows you to place access control restrictions in the PHP script. This

[PHP-DB] Sqlite inserts inside a PDO fetch loop

2010-05-28 Thread Brandon
Hello, I have a situation where I am trying to create an index of words contained in a particular table. The table is about 9,400 rows, and the index ends up being 1,500,000 words (rows). While creating the index, I do a select of the table, and extract the words. I cache these word re

RE: [PHP-DB] File Downloads

2010-05-28 Thread Adam Schroeder
Hi Karl -- It depends -- you could track the download logs in a database and limit based on IP. So your steps would be: 1) User visits PHP script 2) If the user has not downloaded the file before and if the number of downloads is less than 150 then allow them to download. 3) PHP script grabs

Re: [PHP-DB] Sqlite inserts inside a PDO fetch loop

2010-05-28 Thread Phpster
Can't you do a limit in the extract SQL and mark the records extracted so that you don't end up extraxting the same ones? Bastien Sent from my iPod On May 28, 2010, at 5:49 PM, Brandon wrote: Hello, I have a situation where I am trying to create an index of words contained in a partic

Re: [PHP-DB] File Downloads

2010-05-28 Thread Karl DeSaulniers
On May 28, 2010, at 4:49 PM, Michael Stowe wrote: For that you would probably need to setup a databased system in which (best scenario) they would need to register prior to downloading or (not so secure) capture their IP address and prevent that IP from downloading it again (example below).

Re: [PHP-DB] File Downloads

2010-05-28 Thread Karl DeSaulniers
Yes the users will have gone through a registration and login to get to the downloads. The files will be served from MySQL and output to HTML of Flash. Karl On May 28, 2010, at 6:27 PM, Systems wrote: While DB logging is definitely the way to do it, I would suggest not to rely on ip loggi

Re: [PHP-DB] File Downloads

2010-05-28 Thread Karl DeSaulniers
This is for a small project of limited edition audio or pictures or scripts, etc. Hens, "I'd like" to limit each user in the allotted 150 to be able to download (whatever it is) only once. But up to 150 users can get in on it kind of thing. Karl On May 28, 2010, at 6:36 PM, Karl DeSaulniers

RE: [PHP-DB] File Downloads

2010-05-28 Thread Systems
In that case log by login var instead. 1. Create a table that holds the link of the audio file 2. create a join table between the user table and the audio table 3. whenever someone logs in, set the join 4. in your audio link display page set the link to display only if count(id_user) of join is <15

Re: [PHP-DB] File Downloads

2010-05-28 Thread Karl DeSaulniers
Nice breakdown. Thank you. Maybe set up a table that list all the files that user downloads successfully then revert their ability to download ones they already have? Its not that I necessarily am hell-bent on preventing one user from downloading a file again, I just want to set it up so the