Why isn't this simple PHP Forloop working?
<p>First here's the code:</p>

<pre><code>&lt;?php

$qty = $_GET['qty'];

for($i=0; $i &lt; $qty; $i++)
{
    setcookie('animals', $_COOKIE['animals'].'(lion)', time()+3600);
}

?&gt;
</code></pre>

<p>Here's what I'm trying to do:</p>

<p>I want to set the value of the "animals" cookie to "(lion)". The number of instances of "(lion)" that should be in the cookie is determined by the "qty" GET parameter's value. So for example if the pages url is:</p>

<p><code>http://site.com/script.php?qty=10</code></p>

<p>then the value of the cookie should be:</p>

<p><code>(lion)(lion)(lion)(lion)(lion)(lion)(lion)(lion)(lion)(lion)</code></p>

<p>but now it just sets the value once despite the setcookie function being inside the loop, why isn't it working?</p>
