title: How to set 'php setcookie' for html select dropdown
body: <p>I have a jquery ui dialog with an input type in which i put a postcode so people can search with their postcode.</p>
  
  <p>Now i want to make a dropdown with a radius from 5 to 25km.</p>
  
  <p>How can i do this? since i'm new to the setcookie option.</p>
  
  <p>My dropdown code</p>
  
  <pre><code>&lt;select&gt;
      &lt;option disabled selected&gt;Afstand&lt;/option&gt;
      &lt;option&gt;5km&lt;/option&gt;
      &lt;option&gt;10km&lt;/option&gt;
      &lt;option&gt;15km&lt;/option&gt;
      &lt;option&gt;25km&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>This is my cookie code + the dialog div:</p>
  
  <pre><code>&lt;div id="dialog" class="hidden" title="Welkom bij OostWestRegioBest.nl"&gt;
  
      Zoeken in uw regio.
  
      &lt;br/&gt;&lt;br/&gt;
  
      &lt;form method="post" action""&gt;
          &lt;input type="text" name="postcode" placeholder="postcode"&gt;
          &lt;br/&gt;&lt;br/&gt;
              // 
              **// Here will be my select dropdown**
              //
          &lt;input type="submit" value="Opslaan"&gt;
          &lt;input type="hidden" name="submitted" value="true"&gt;
          &lt;input type="hidden" name="afstand" value="true" /&gt;
      &lt;/form&gt;
  
  &lt;?php
  
      if(isset($_POST['postcode']))
      {
          setcookie('postcode', $_POST['postcode'], time() + (20 * 365 * 24 * 60 * 60));
          header("location: {$_SERVER['PHP_SELF']}");
      };
  
  ?&gt;
  </code></pre>
  
  <p>and here my code to show the cookie for the postcode:</p>
  
  <pre><code>&lt;input type="text" name="postcode" value='&lt;?php echo isset($_COOKIE['postcode']) ? $_COOKIE['postcode'] : '' ?&gt;'&gt;   
  </code></pre>
  
  <p>Thanks in advance.</p>