title: PHP randomly printing code within php tags
body: <p>I wrote some PHP/sql with the intention of storing session variables into a SQL table. (I left out some html that tells the user that the php worked.)</p>
  
  <pre><code>&lt;?php
  session_start();
  $name = $_REQUEST["name"];
  $type = $_REQUEST["type"];
  $lengthnum = $_REQUEST["lengthnum"];
  $rewardnum = $_REQUEST["rewardnum"];
  $itemreward = $_REQUEST["itemreward"];
  
  $dsn = "mysql:host=localhost;dbname=xxxxxx";
  $username = "xxxxxxxxx";
  $pw = "xxxxxxxx";
  $options = array(PDO ::ATTR_ERRMODE=&gt;PDO ::ERRMODE_EXCEPTION);
  try
  {
      $my_pdo = new PDO ($dsn, $username, $pw, $options);
      $sql_stmt = "INSERT INTO xxxxxx (Name, Type, Length, Reward, Item)
                   VALUES ($name, $type, $lengthnum, $rewardnum, $itemreward)";
      $my_pdo-&gt;query($sql_stmt);
  }
  catch(Exception $a)
  {
      echo "&lt;p&gt;Error..." . $a-&gt;getMessage() . "&lt;/p&gt;";
  }
  ?&gt;
  </code></pre>
  
  <p>For some reason this code "breaks" out of the php tags after "$options = array(" and this is output to the html file.  </p>
  
  <pre><code>PDO ::ERRMODE_EXCEPTION); try { $my_pdo = new PDO ($dsn, $username, $pw, $options); $sql_stmt = "INSERT INTO simpleWFA (Name, Type, Length, Reward, Item) VALUES ($name, $type, $lengthnum, $rewardnum, $itemreward)"; $my_pdo-&gt;query($sql_stmt); } catch(Exception $a) { echo "
  
  Error..." . $a-&gt;getMessage() . "
  "; } ?&gt;
  </code></pre>
  
  <p>Thanks!</p>