title: Simple PHP calculator
body: <p>I'm creating a basic PHP calculator that lets you enter two values and chose your operator then displays the answer. Everything is working fine except it's not outputting the answer to the browser.</p>
  
  <p>Here are the codes for my html and PHP files:
       
       </p>
  
  <pre><code>&lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Calculator&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form method="post" attribute="post" action="disp_form.php"&gt;
  &lt;p&gt;First Value:&lt;br/&gt;
  &lt;input type="text" id="first" name="first"&gt;&lt;/p&gt;
  &lt;p&gt;Second Value:&lt;br/&gt;
  &lt;input type="text" id="second" name="second"&gt;&lt;/p&gt;
  &lt;input type="radio" name="group1" id="add" value="add" checked="true"&gt;&lt;p&gt;+&lt;/p&gt;&lt;br/&gt;
  &lt;input type="radio" name="group1" id="subtract" value="subtract"&gt;&lt;p&gt;-&lt;/p&gt;&lt;br/&gt;
  &lt;input type="radio" name="group1" id="times" value="times"&gt;&lt;p&gt;x&lt;/p&gt;&lt;br/&gt;
  &lt;input type="radio" name="group1" id="divide" value="divide"&gt;&lt;p&gt;/&lt;/p&gt;&lt;br/&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;button type="submit" name="answer" id="answer" value="answer"&gt;Calculate&lt;/button&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>PHP file:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;title&gt;Answer&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;p&gt;The answer is: 
  &lt;?php
  if($_POST['group1'] == add) {
  echo "$first + $second";
  }
  else if($_POST['group1'] == subtract) {
  echo "$first - $second";
  }
  else if($_POST['group1'] == times) {
  echo "$first * $second";
  }
  else($_POST['group1'] == divide) {
  echo "$first / $second";
  }
  ?&gt;
  &lt;/p&gt; 
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>