title: PHP will not execute properly and only displays as text
body: <p>My entire PHP page only displays as text and no PHP code is executed. It's weird because when I test it using <code>&lt;? phpinfo(); ?&gt;</code> in a test.php file, I get a successful test and it works on my Apache server. However when I attempt to do anything else. It only shows as text.</p>
  
  <p>Edit: Here is the link to the code. I couldn't figure out how to post it here. <a href="http://pastebin.com/UdWq8Gmc" rel="nofollow">Pastebin</a></p>
  
  <pre><code>&lt;?php
    // create short variable names
    $tireqty = $_POST['tireqty'];
    $oilqty = $_POST['oilqty'];
    $sparkqty = $_POST['sparkqty'];
    $find = $_POST['find'];
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Bob's Auto Parts - Order Results&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Bob's Auto Parts&lt;/h1&gt;
  &lt;h2&gt;Order Results&lt;/h2&gt;
  &lt;?php
  
      echo "&lt;p&gt;Order processed at ".date('H:i, jS F Y')."&lt;/p&gt;";
  
      echo "&lt;p&gt;Your order is as follows: &lt;/p&gt;";
  
      $totalqty = 0;
      $totalqty = $tireqty + $oilqty + $sparkqty;
      echo "Items ordered: ".$totalqty."&lt;br /&gt;";
  
  
      if ($totalqty == 0) {
  
        echo "You did not order anything on the previous page!&lt;br /&gt;";
  
      } else {
  
        if ($tireqty &gt; 0) {
          echo $tireqty." tires&lt;br /&gt;";
        }
  
        if ($oilqty &gt; 0) {
          echo $oilqty." bottles of oil&lt;br /&gt;";
        }
  
        if ($sparkqty &gt; 0) {
          echo $sparkqty." spark plugs&lt;br /&gt;";
        }
      }
  
  
      $totalamount = 0.00;
  
      define('TIREPRICE', 100);
      define('OILPRICE', 10);
      define('SPARKPRICE', 4);
  
      $totalamount = $tireqty * TIREPRICE
                   + $oilqty * OILPRICE
                   + $sparkqty * SPARKPRICE;
  
      echo "Subtotal: $".number_format($totalamount,2)."&lt;br /&gt;";
  
      $taxrate = 0.10;  // local sales tax is 10%
      $totalamount = $totalamount * (1 + $taxrate);
      echo "Total including tax: $".number_format($totalamount,2)."&lt;br /&gt;";
  
      if($find == "a") {
        echo "&lt;p&gt;Regular customer.&lt;/p&gt;";
      } elseif($find == "b") {
        echo "&lt;p&gt;Customer referred by TV advert.&lt;/p&gt;";
      } elseif($find == "c") {
        echo "&lt;p&gt;Customer referred by phone directory.&lt;/p&gt;";
      } elseif($find == "d") {
        echo "&lt;p&gt;Customer referred by word of mouth.&lt;/p&gt;";
      } else {
        echo "&lt;p&gt;We do not know how this customer found us.&lt;/p&gt;";
      }
  
  ?&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>