title: Undefined index in PHP error when testing
body: <p>I have a minor problem. When I use this code: </p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Declare Nerf War!&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;?php
          $form="&lt;center&gt;&lt;form action='decwargen.php' method='POST'&gt;
              Your Name: &lt;input type='text' name='yname' placeholder='John Doe'&gt;&lt;br&gt;
              Opponent's Name: &lt;input type='text' name='oname' placeholder='Jane Doe'&gt;&lt;br&gt;
              Why? &lt;input type='text' name='why' placeholder='for stealing my stuff'&gt;&lt;br&gt;
              Date of war: &lt;input type='text' name='dwar' placeholder='10/11/13'&gt;&lt;br&gt;
              Time of war: &lt;input type='text' name='twar' placeholder='10:56 PM'&gt;&lt;br&gt;
              Created on: &lt;input type='text name='crtd' placeholder='10/10/13'&gt;&lt;br&gt;
              &lt;input type='submit' name='subbut' value='Submit'&gt;&lt;/center&gt;
          &lt;/form&gt;";
          $ok = $_POST ['subbut'];
          if($ok){
              $yname = $_POST ['yname'];
              $oname = $_POST ['oname'];
              $why = $_POST ['why'];
              $dwar = $_POST ['dwar'];
              $twar = $_POST ['twar'];
              $created = $_POST ['crtd'];
              echo("&lt;center&gt;&lt;h1&gt;Declaration of war&lt;/h1&gt;&lt;br&gt;&lt;p contenteditable='true'&gt;I, " . $yname . " declare war on " . $oname . " for/because " . $why . ". This will happen on " . $dwar . " at " . $twar . ".&lt;br&gt;Created on" . $created);
          } else echo($form);
          ?&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The web browser says: </p>
  
  <blockquote>
    <p>Notice: Undefined index: subbut in /Applications/MAMP/htdocs/decwargen.php on line 17 </p>
  </blockquote>
  
  <p>when I first go to the page, then </p>
  
  <blockquote>
    <p>Notice: Undefined index: crtd in /Applications/MAMP/htdocs/decwargen.php on line 24 </p>
  </blockquote>
  
  <p>when I enter data. Can anyone please help?</p>