title: getting cookie value from php form
body: <p>what do I set the cookie value and name to be for a value a user may enter in a form? and what do i use to display that value on my second page? (I can't not use cookies for this, so while there may be a smarter way to do this, I would just like to know how to do it with cookies!!) Thanks!</p>
  
  <pre><code>&lt;?php
  setcookie($color, 'color');
  setcookie($name, 'name');
  ?&gt;
  
  &lt;?php
  echo "&lt;form action=\"form_data.php\" method=\"post\"&gt;";
  echo "favorite color:&lt;input type=\"text\" name=\"color\" size=\"20\"&gt;&lt;br/&gt;";
  echo "name:&lt;input type=\"text\" name=\"name\" size=\"20\"&gt;&lt;br/&gt;";
  echo "&lt;input type=\"submit\" value=\"Submit\" /&gt;";
  echo "&lt;br /&gt;&lt;input type=\"hidden\" name=\"submitted\" value=\"true\" /&gt;";
  ?&gt;
  </code></pre>
  
  <p>data on form_data:</p>
  
  <pre><code>  &lt;?php
    echo "&lt;b&gt;fav color:&lt;/b&gt;".$_COOKIE['color'];
    echo "&lt;b&gt;name:&lt;/b&gt;".$_COOKIE['name'];
    ?&gt;
  </code></pre>