title: Converting Fahrenheit to Celsius in php
body: <p>Not sure why fahrenheit to celsius isn't working. Celsius to Fahren is working fine. Its possible I am missing something very simple, but I have no idea way. php noob here.</p>
  
  <pre><code>&lt;?php
  
  
  if (isset($_POST['celsius'])) {
      $c = $_POST['celsius'];
      $f = ($c * 9/5) + 32;
      echo "&lt;pre&gt;$c Celsius is " .$f ." Fahrenheit&lt;/pre&gt;";
  }
  
  if (isset($_POST['fahren'])) {
      $fah = $_POST['fahren'];
      $cen = ($fah - 32) / 1.8;
      echo "&lt;pre&gt;$fah Fahrenheit is " .$cen ." Celsius&lt;/pre&gt;";
  }
  
  // (°F - 32) / 1.8 = °C
  
  
  echo &lt;&lt;&lt;_END
  
  &lt;pre&gt;
  &lt;form method="post" action="10-unit-converter.php"&gt;
  
  Celsius to Fahrenheit:
      &lt;input type="text" name="celsius" size="7" /&gt;
      &lt;input type="submit" value="Fahrenheit" /&gt;
  
  &lt;br&gt;
  
  Fahrenheit to Celsius: 
      &lt;input type="text" name"fahren" size="7" /&gt;
      &lt;input type="submit" value="Celsius" /&gt;
  
  
  
  &lt;/form&gt;
  &lt;/pre&gt;
  
  
  _END
  
  ?&gt;
  </code></pre>