title: create img elements with php, source=variable cookie
body: <p>How to create image elements with php and the source is a cookie i have set earlier?
  I got some code, but it seems not working... Nothing is happening when i refresh the page.</p>
  
  <p>I got a javascript code that set the first cookie to link1 with a value that is wrote in the top input box, and next cookie sets to link2 and so on.</p>
  
  <p>My goal is to output 4 image elements if i have 4 "link cookies" set.</p>
  
  <p>Here's what i got so far.</p>
  
  <pre><code>&lt;form&gt;
      &lt;input id="link" type="text" placeholder="länk address"&gt;
      &lt;input id="image" type="text" placeholder="bild address"&gt;
      &lt;button onClick="createLink();"&gt;Lägg till länk&lt;/button&gt;
  &lt;/form&gt;
   &lt;?php
      for ($x = 1; isset($_COOKIE["link.$x."]); $x++) {
           $_COOKIE["link.$x."] = $link;
           $_COOKIE["image.$x."] = $image;
           echo '&lt;a href="'.$link.'"&gt;&lt;img src="'.$image.'"&gt;&lt;/a&gt;';
      }
  ?&gt;
  </code></pre>