<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Limit the number of downloads per client</title>
	<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/</link>
	<description>Web development tutorials, SEO articles and PHP script resources</description>
	<pubDate>Thu, 07 Aug 2008 20:17:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-75556</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Fri, 07 Mar 2008 08:57:26 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-75556</guid>
		<description>Please post further questions via the forum:
http://www.finalwebsites.com/forums/</description>
		<content:encoded><![CDATA[<p>Please post further questions via the forum:<br />
<a href="http://www.finalwebsites.com/forums/" rel="nofollow">http://www.finalwebsites.com/forums/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernd</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-61060</link>
		<dc:creator>Bernd</dc:creator>
		<pubDate>Mon, 07 Jan 2008 16:53:19 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-61060</guid>
		<description>Thanks for reply, but i'm also on a shared server. I know there a php script which can limit the downloadspeed, but it can't also limit the numbers per client, what your script can.....</description>
		<content:encoded><![CDATA[<p>Thanks for reply, but i&#8217;m also on a shared server. I know there a php script which can limit the downloadspeed, but it can&#8217;t also limit the numbers per client, what your script can&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-61040</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Mon, 07 Jan 2008 16:06:22 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-61040</guid>
		<description>@Bernd try mod_bandwidth (link is posted before)</description>
		<content:encoded><![CDATA[<p>@Bernd try mod_bandwidth (link is posted before)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bernd</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-60864</link>
		<dc:creator>Bernd</dc:creator>
		<pubDate>Sun, 06 Jan 2008 14:47:16 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-60864</guid>
		<description>What about to implement an speedlimit for downloads ?? This was an feature i'm always looking for, and it was great when your script can also do this !</description>
		<content:encoded><![CDATA[<p>What about to implement an speedlimit for downloads ?? This was an feature i&#8217;m always looking for, and it was great when your script can also do this !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ozzWANTED</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-60375</link>
		<dc:creator>ozzWANTED</dc:creator>
		<pubDate>Thu, 03 Jan 2008 21:06:01 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-60375</guid>
		<description>Great tool :) I've been searching for a last few days for something like this one tool, becouse I have a few malignant bandwidth bloodsucker , who are trying overuse my bw.</description>
		<content:encoded><![CDATA[<p>Great tool <img src='http://www.web-development-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I&#8217;ve been searching for a last few days for something like this one tool, becouse I have a few malignant bandwidth bloodsucker , who are trying overuse my bw.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-53131</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Tue, 27 Nov 2007 18:19:15 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-53131</guid>
		<description>@snowden

yes, that helps with some proxies but not for all those web proxies around here :(</description>
		<content:encoded><![CDATA[<p>@snowden</p>
<p>yes, that helps with some proxies but not for all those web proxies around here <img src='http://www.web-development-blog.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: snowden</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-53120</link>
		<dc:creator>snowden</dc:creator>
		<pubDate>Tue, 27 Nov 2007 17:41:39 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-53120</guid>
		<description>&lt;p&gt;Update:&lt;/p&gt;
&lt;p&gt;I solved the problem above, u can disregard it. :)&lt;/p&gt;
&lt;p&gt;However, a suggestion for finding the user's IP.&lt;/p&gt;
&lt;p&gt;As you probably already know, finding an IP doesn' always work, the user could be behind a proxy for example. Or maybe they have a dynamic IP. You could instead use this to find the IP:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {&lt;br /&gt;
	 $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];&lt;br /&gt;
	} else {&lt;br /&gt;
 $ip = $_SERVER['REMOTE_ADDR'];&lt;br /&gt;
}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Obviously it's not foolproof, but it does work.&lt;/p&gt;
&lt;p&gt;Better than this would be to log both IP addresses associated with the one download, and limit it that way. :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Update:</p>
<p>I solved the problem above, u can disregard it. <img src='http://www.web-development-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>However, a suggestion for finding the user&#8217;s IP.</p>
<p>As you probably already know, finding an IP doesn&#8217; always work, the user could be behind a proxy for example. Or maybe they have a dynamic IP. You could instead use this to find the IP:</p>
<p><code>if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {<br />
	 $ip = $_SERVER[&#8217;HTTP_X_FORWARDED_FOR&#8217;];<br />
	} else {<br />
 $ip = $_SERVER[&#8217;REMOTE_ADDR&#8217;];<br />
}</code></p>
<p>Obviously it&#8217;s not foolproof, but it does work.</p>
<p>Better than this would be to log both IP addresses associated with the one download, and limit it that way. <img src='http://www.web-development-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-52635</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Mon, 26 Nov 2007 07:26:53 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-52635</guid>
		<description>@snowden,

please post your questions &lt;a href="http://www.webdigity.com/index.php/board,77.0.html,ref.olaf" rel="nofollow"&gt;here&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@snowden,</p>
<p>please post your questions <a href="http://www.webdigity.com/index.php/board,77.0.html,ref.olaf" rel="nofollow">here</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: snowden</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-52537</link>
		<dc:creator>snowden</dc:creator>
		<pubDate>Sun, 25 Nov 2007 22:26:55 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-52537</guid>
		<description>How would I edit this script, so that a user is limited (by ip) on the total transfer amount per time (e.g. 5GB per day), regardless of what file they download?

Assume this is done; then obviously if they download the same file over and over, it will still be added to the overall transfer bandwidth. So if I was to leave the file 'downloaded' record intact (in the MYSQL database), how would I then allow the same user (identified by IP) to download the same file over and over, without it being added to their bandwidth? What I mean is, if the connection somehow times out for a file they are downloading, how can I allow them to try download it again (without increasing their IP's overall bandwidth transfer)?

Also, has anyone any idea on how I could store IP addresses in a textfile as opposed to a database, for increased speed (or reduced load on the server - but could this pose a security risk)?

cheers!</description>
		<content:encoded><![CDATA[<p>How would I edit this script, so that a user is limited (by ip) on the total transfer amount per time (e.g. 5GB per day), regardless of what file they download?</p>
<p>Assume this is done; then obviously if they download the same file over and over, it will still be added to the overall transfer bandwidth. So if I was to leave the file &#8216;downloaded&#8217; record intact (in the MYSQL database), how would I then allow the same user (identified by IP) to download the same file over and over, without it being added to their bandwidth? What I mean is, if the connection somehow times out for a file they are downloading, how can I allow them to try download it again (without increasing their IP&#8217;s overall bandwidth transfer)?</p>
<p>Also, has anyone any idea on how I could store IP addresses in a textfile as opposed to a database, for increased speed (or reduced load on the server - but could this pose a security risk)?</p>
<p>cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olaf</title>
		<link>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-52512</link>
		<dc:creator>Olaf</dc:creator>
		<pubDate>Sun, 25 Nov 2007 20:14:48 +0000</pubDate>
		<guid>http://www.web-development-blog.com/archives/limit-the-number-of-downloads-per-client/#comment-52512</guid>
		<description>sure why not (send a trackback)

The direct output is one way, used the symlinks too and just used a script to register the "access data" in the database.</description>
		<content:encoded><![CDATA[<p>sure why not (send a trackback)</p>
<p>The direct output is one way, used the symlinks too and just used a script to register the &#8220;access data&#8221; in the database.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
