File Downloads

File Downloads

am 28.05.2010 22:39:20 von Karl DeSaulniers

--Apple-Mail-2-419216782
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

Hello,
How can I go about restricting the number of downloads of a file on
my server?
For Eg: if I want a music track to only be able to be downloaded by
150 people and thats it.. ever,
how can I go about doing this?

Much obliged,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



--Apple-Mail-2-419216782--

RE: File Downloads

am 28.05.2010 23:18:43 von Adam Schroeder

Hi Karl --

You can store the file contents outside of the web tree and use PHP to "rea=
d" the contents. This allows you to place access control restrictions in t=
he PHP script.

This post talks about doing something similar with images. Obviously, if y=
ou have a music track... you'll need to adjust the mime type accordingly.

http://stackoverflow.com/questions/258365/php-link-to-image- file-outside-de=
fault-web-directory/258380#258380

Good luck.

Adam


-----Original Message-----
From: Karl DeSaulniers [mailto:karl@designdrumm.com]=20
Sent: Friday, May 28, 2010 1:39 PM
To: php-db@lists.php.net
Subject: [PHP-DB] File Downloads

Hello,
How can I go about restricting the number of downloads of a file on =20
my server?
For Eg: if I want a music track to only be able to be downloaded by =20
150 people and thats it.. ever,
how can I go about doing this?

Much obliged,

Karl DeSaulniers
Design Drumm
http://designdrumm.com



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File Downloads

am 28.05.2010 23:33:45 von 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.
> Obviously, if you have a music track... you'll need to adjust the
> mime type accordingly.
>
> http://stackoverflow.com/questions/258365/php-link-to-image- file-
> outside-default-web-directory/258380#258380
>
> Good luck.
>
> Adam
>
>
> -----Original Message-----
> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
> Sent: Friday, May 28, 2010 1:39 PM
> To: php-db@lists.php.net
> Subject: [PHP-DB] File Downloads
>
> Hello,
> How can I go about restricting the number of downloads of a file on
> my server?
> For Eg: if I want a music track to only be able to be downloaded by
> 150 people and thats it.. ever,
> how can I go about doing this?
>
> Much obliged,
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>

Very Nice. Good link.
I think this is the route I may go.
Seems a bit more secure if the php script gains access to the file
through the .htaccess files set-up.

Thanks Adam.

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File Downloads

am 28.05.2010 23:36:03 von 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 post talks about doing something similar with images.
>> Obviously, if you have a music track... you'll need to adjust the
>> mime type accordingly.
>>
>> http://stackoverflow.com/questions/258365/php-link-to-image- file-
>> outside-default-web-directory/258380#258380
>>
>> Good luck.
>>
>> Adam
>>
>>
>> -----Original Message-----
>> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
>> Sent: Friday, May 28, 2010 1:39 PM
>> To: php-db@lists.php.net
>> Subject: [PHP-DB] File Downloads
>>
>> Hello,
>> How can I go about restricting the number of downloads of a file on
>> my server?
>> For Eg: if I want a music track to only be able to be downloaded by
>> 150 people and thats it.. ever,
>> how can I go about doing this?
>>
>> Much obliged,
>>
>> Karl DeSaulniers
>> Design Drumm
>> http://designdrumm.com
>>
>>
>
> Very Nice. Good link.
> I think this is the route I may go.
> Seems a bit more secure if the php script gains access to the file
> through the .htaccess files set-up.
>
> Thanks Adam.
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

But how do I tetect if a file has been downloaded by multiple people
and in the process stop someone who has downloaded it once to not be
able to do again?
THX

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: File Downloads

am 28.05.2010 23:51:24 von Adam Schroeder

Hi Karl --

It depends -- you could track the download logs in a database and limit bas=
ed 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 down=
loads is less than 150 then allow them to download.

3) PHP script grabs user's IP address from $_SERVER['REMOTE_ADDR'].

4) When the script's copy function completes, register the user's IP addres=
s in a database. You can later check against this to verify they have not =
downloaded the file.

Using IP addresses for this type of control come with problems... but depen=
ding on the importance of the content -- it should be good.

Adam
=20

-----Original Message-----
From: Karl DeSaulniers [mailto:karl@designdrumm.com]=20
Sent: Friday, May 28, 2010 2:36 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] File Downloads


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 =20
>> PHP to "read" the contents. This allows you to place access =20
>> control restrictions in the PHP script.
>>
>> This post talks about doing something similar with images. =20
>> Obviously, if you have a music track... you'll need to adjust the =20
>> mime type accordingly.
>>
>> http://stackoverflow.com/questions/258365/php-link-to-image- file-=20
>> outside-default-web-directory/258380#258380
>>
>> Good luck.
>>
>> Adam
>>
>>
>> -----Original Message-----
>> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
>> Sent: Friday, May 28, 2010 1:39 PM
>> To: php-db@lists.php.net
>> Subject: [PHP-DB] File Downloads
>>
>> Hello,
>> How can I go about restricting the number of downloads of a file on
>> my server?
>> For Eg: if I want a music track to only be able to be downloaded by
>> 150 people and thats it.. ever,
>> how can I go about doing this?
>>
>> Much obliged,
>>
>> Karl DeSaulniers
>> Design Drumm
>> http://designdrumm.com
>>
>>
>
> Very Nice. Good link.
> I think this is the route I may go.
> Seems a bit more secure if the php script gains access to the file =20
> through the .htaccess files set-up.
>
> Thanks Adam.
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> --=20
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

But how do I tetect if a file has been downloaded by multiple people =20
and in the process stop someone who has downloaded it once to not be =20
able to do again?
THX

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--=20
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File Downloads

am 29.05.2010 00:39:06 von Karl DeSaulniers

--Apple-Mail-15-426402755
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed

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).
>
> Since you are already using the php script to detect the download,
> you could simply add (assuming MySQL) a Mysql query such as:
>
> $result = mysql_query('select dt.downloads, ip.ip_address from
> downloads_table dt RIGHT JOIN downloads_ip ip ON ip.track_id = "%
> your track id%" AND ip.ip_address = "'.$_SERVER
> ['REMOTE_ADDRESS'].'" where dt.track_id = "%your track id%"');
> $results = mysql_fetch_array($result);
>
> if(($results['downloads'] <= 150) && (empty($results
> ['ip_address']))) {
>
> mysql_query('INSERT INTO downloads_ip (track_id,ip_address) VALUES
> ("%track_id%","'.$_SERVER['REMOTE_ADDRESS'].'")'); // insert IP
> into downloads_ip table
> mysql_query('UPDATE downloads_table SET downloads = downloads + 1
> WHERE track_id = "%track_id%" LIMIT 1'); // update the count of the
> downloads
> // do download here
>
> } elseif (!empty($results['ip_address'])) {
> echo 'you have already downloaded this track...';
>
> } else {
> echo 'this track is no longer available for download';
> }
>
>
> (note I haven't checked the code, but it should give you a quick
> example of how you can keep track of this)
>
> Hope this helps, and if you have any questions just let me know.
>
> Take care,
> Mike :o)
>
>
>
> "My command is this: Love each other as I
> have loved you." John 15:12
>
> -----------------------


Oh my.. thank you for that.



Karl DeSaulniers
Design Drumm
http://designdrumm.com


--Apple-Mail-15-426402755--

Re: File Downloads

am 29.05.2010 01:36:42 von 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 logging as authentication mechanism for following reasons:
> Most end-users are on a dynamic IP.
> One IP can/will serve multiple users (any large institution with
> wireless
> (Universities, Hospitals etc.) will have hundreds or thousands of
> people
> surfing with one public IP - which is the IP you're logging)
>
> Is there any reason not to log them in by personalized means? (such as
> email/username)
>
> -----Original Message-----
> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
> Sent: Friday, May 28, 2010 6:39 PM
> To: php-db@lists.php.net
> Subject: Re: [PHP-DB] File Downloads
>
> 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).
>>
>> Since you are already using the php script to detect the download,
>> you
>> could simply add (assuming MySQL) a Mysql query such as:
>>
>> $result = mysql_query('select dt.downloads, ip.ip_address from
>> downloads_table dt RIGHT JOIN downloads_ip ip ON ip.track_id = "%
>> your
>> track id%" AND ip.ip_address = "'.$_SERVER ['REMOTE_ADDRESS'].'"
>> where
>> dt.track_id = "%your track id%"'); $results =
>> mysql_fetch_array($result);
>>
>> if(($results['downloads'] <= 150) && (empty($results
>> ['ip_address']))) {
>>
>> mysql_query('INSERT INTO downloads_ip (track_id,ip_address) VALUES
>> ("%track_id%","'.$_SERVER['REMOTE_ADDRESS'].'")'); // insert IP into
>> downloads_ip table mysql_query('UPDATE downloads_table SET
>> downloads =
>> downloads + 1 WHERE track_id = "%track_id%" LIMIT 1'); // update the
>> count of the downloads // do download here
>>
>> } elseif (!empty($results['ip_address'])) { echo 'you have already
>> downloaded this track...';
>>
>> } else {
>> echo 'this track is no longer available for download'; }
>>
>>
>> (note I haven't checked the code, but it should give you a quick
>> example of how you can keep track of this)
>>
>> Hope this helps, and if you have any questions just let me know.
>>
>> Take care,
>> Mike :o)
>>
>>
>>
>> "My command is this: Love each other as I
>> have loved you." John 15:12
>>
>> -----------------------
>
>
> Oh my.. thank you for that.
>
>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File Downloads

am 29.05.2010 01:39:48 von 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 wrote:

> 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 logging as authentication mechanism for following reasons:
>> Most end-users are on a dynamic IP.
>> One IP can/will serve multiple users (any large institution with
>> wireless
>> (Universities, Hospitals etc.) will have hundreds or thousands of
>> people
>> surfing with one public IP - which is the IP you're logging)
>>
>> Is there any reason not to log them in by personalized means?
>> (such as
>> email/username)
>>
>> -----Original Message-----
>> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
>> Sent: Friday, May 28, 2010 6:39 PM
>> To: php-db@lists.php.net
>> Subject: Re: [PHP-DB] File Downloads
>>
>> 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).
>>>
>>> Since you are already using the php script to detect the
>>> download, you
>>> could simply add (assuming MySQL) a Mysql query such as:
>>>
>>> $result = mysql_query('select dt.downloads, ip.ip_address from
>>> downloads_table dt RIGHT JOIN downloads_ip ip ON ip.track_id = "%
>>> your
>>> track id%" AND ip.ip_address = "'.$_SERVER ['REMOTE_ADDRESS'].'"
>>> where
>>> dt.track_id = "%your track id%"'); $results =
>>> mysql_fetch_array($result);
>>>
>>> if(($results['downloads'] <= 150) && (empty($results
>>> ['ip_address']))) {
>>>
>>> mysql_query('INSERT INTO downloads_ip (track_id,ip_address) VALUES
>>> ("%track_id%","'.$_SERVER['REMOTE_ADDRESS'].'")'); // insert IP into
>>> downloads_ip table mysql_query('UPDATE downloads_table SET
>>> downloads =
>>> downloads + 1 WHERE track_id = "%track_id%" LIMIT 1'); // update the
>>> count of the downloads // do download here
>>>
>>> } elseif (!empty($results['ip_address'])) { echo 'you have already
>>> downloaded this track...';
>>>
>>> } else {
>>> echo 'this track is no longer available for download'; }
>>>
>>>
>>> (note I haven't checked the code, but it should give you a quick
>>> example of how you can keep track of this)
>>>
>>> Hope this helps, and if you have any questions just let me know.
>>>
>>> Take care,
>>> Mike :o)
>>>
>>>
>>>
>>> "My command is this: Love each other as I
>>> have loved you." John 15:12
>>>
>>> -----------------------
>>
>>
>> Oh my.. thank you for that.
>>
>>
>>
>> Karl DeSaulniers
>> Design Drumm
>> http://designdrumm.com
>>
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

RE: File Downloads

am 29.05.2010 02:05:08 von 3dgtech

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 <150 or username Is logged in join table (so the
150 first authenticated users can retrieve the file more than once...)

Good luck
Eli

-----Original Message-----
From: Karl DeSaulniers [mailto:karl@designdrumm.com]
Sent: Friday, May 28, 2010 7:40 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] File Downloads

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 wrote:

> 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 logging as authentication mechanism for following
>> reasons:
>> Most end-users are on a dynamic IP.
>> One IP can/will serve multiple users (any large institution with
>> wireless (Universities, Hospitals etc.) will have hundreds or
>> thousands of people surfing with one public IP - which is the IP
>> you're logging)
>>
>> Is there any reason not to log them in by personalized means?
>> (such as
>> email/username)
>>
>> -----Original Message-----
>> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
>> Sent: Friday, May 28, 2010 6:39 PM
>> To: php-db@lists.php.net
>> Subject: Re: [PHP-DB] File Downloads
>>
>> 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).
>>>
>>> Since you are already using the php script to detect the download,
>>> you could simply add (assuming MySQL) a Mysql query such as:
>>>
>>> $result = mysql_query('select dt.downloads, ip.ip_address from
>>> downloads_table dt RIGHT JOIN downloads_ip ip ON ip.track_id = "%
>>> your track id%" AND ip.ip_address = "'.$_SERVER
>>> ['REMOTE_ADDRESS'].'"
>>> where
>>> dt.track_id = "%your track id%"'); $results =
>>> mysql_fetch_array($result);
>>>
>>> if(($results['downloads'] <= 150) && (empty($results
>>> ['ip_address']))) {
>>>
>>> mysql_query('INSERT INTO downloads_ip (track_id,ip_address) VALUES
>>> ("%track_id%","'.$_SERVER['REMOTE_ADDRESS'].'")'); // insert IP into
>>> downloads_ip table mysql_query('UPDATE downloads_table SET downloads
>>> = downloads + 1 WHERE track_id = "%track_id%" LIMIT 1'); // update
>>> the count of the downloads // do download here
>>>
>>> } elseif (!empty($results['ip_address'])) { echo 'you have already
>>> downloaded this track...';
>>>
>>> } else {
>>> echo 'this track is no longer available for download'; }
>>>
>>>
>>> (note I haven't checked the code, but it should give you a quick
>>> example of how you can keep track of this)
>>>
>>> Hope this helps, and if you have any questions just let me know.
>>>
>>> Take care,
>>> Mike :o)
>>>
>>>
>>>
>>> "My command is this: Love each other as I
>>> have loved you." John 15:12
>>>
>>> -----------------------
>>
>>
>> Oh my.. thank you for that.
>>
>>
>>
>> Karl DeSaulniers
>> Design Drumm
>> http://designdrumm.com
>>
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: File Downloads

am 29.05.2010 02:15:13 von 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 results they have to download from
are -1 less every completed download.
Hens the one they just downloaded is not there anymore.

Thanks for your help.

Karl


On May 28, 2010, at 7:05 PM, Systems wrote:

> 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 <150 or username Is logged in join table
> (so the
> 150 first authenticated users can retrieve the file more than once...)
>
> Good luck
> Eli
>
> -----Original Message-----
> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
> Sent: Friday, May 28, 2010 7:40 PM
> To: php-db@lists.php.net
> Subject: Re: [PHP-DB] File Downloads
>
> 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 wrote:
>
>> 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 logging as authentication mechanism for following
>>> reasons:
>>> Most end-users are on a dynamic IP.
>>> One IP can/will serve multiple users (any large institution with
>>> wireless (Universities, Hospitals etc.) will have hundreds or
>>> thousands of people surfing with one public IP - which is the IP
>>> you're logging)
>>>
>>> Is there any reason not to log them in by personalized means?
>>> (such as
>>> email/username)
>>>
>>> -----Original Message-----
>>> From: Karl DeSaulniers [mailto:karl@designdrumm.com]
>>> Sent: Friday, May 28, 2010 6:39 PM
>>> To: php-db@lists.php.net
>>> Subject: Re: [PHP-DB] File Downloads
>>>
>>> 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).
>>>>
>>>> Since you are already using the php script to detect the download,
>>>> you could simply add (assuming MySQL) a Mysql query such as:
>>>>
>>>> $result = mysql_query('select dt.downloads, ip.ip_address from
>>>> downloads_table dt RIGHT JOIN downloads_ip ip ON ip.track_id = "%
>>>> your track id%" AND ip.ip_address = "'.$_SERVER
>>>> ['REMOTE_ADDRESS'].'"
>>>> where
>>>> dt.track_id = "%your track id%"'); $results =
>>>> mysql_fetch_array($result);
>>>>
>>>> if(($results['downloads'] <= 150) && (empty($results
>>>> ['ip_address']))) {
>>>>
>>>> mysql_query('INSERT INTO downloads_ip (track_id,ip_address) VALUES
>>>> ("%track_id%","'.$_SERVER['REMOTE_ADDRESS'].'")'); // insert IP
>>>> into
>>>> downloads_ip table mysql_query('UPDATE downloads_table SET
>>>> downloads
>>>> = downloads + 1 WHERE track_id = "%track_id%" LIMIT 1'); // update
>>>> the count of the downloads // do download here
>>>>
>>>> } elseif (!empty($results['ip_address'])) { echo 'you have already
>>>> downloaded this track...';
>>>>
>>>> } else {
>>>> echo 'this track is no longer available for download'; }
>>>>
>>>>
>>>> (note I haven't checked the code, but it should give you a quick
>>>> example of how you can keep track of this)
>>>>
>>>> Hope this helps, and if you have any questions just let me know.
>>>>
>>>> Take care,
>>>> Mike :o)
>>>>
>>>>
>>>>
>>>> "My command is this: Love each other as I
>>>> have loved you." John 15:12
>>>>
>>>> -----------------------
>>>
>>>
>>> Oh my.. thank you for that.
>>>
>>>
>>>
>>> Karl DeSaulniers
>>> Design Drumm
>>> http://designdrumm.com
>>>
>>>
>>
>> Karl DeSaulniers
>> Design Drumm
>> http://designdrumm.com
>>
>>
>> --
>> PHP Database Mailing List (http://www.php.net/) To unsubscribe,
>> visit:
>> http://www.php.net/unsub.php
>>
>
> Karl DeSaulniers
> Design Drumm
> http://designdrumm.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php