title: HTML form using POST to get PHP passing data to MS Access
body: <p>Hi I have two pieces of code set up</p>
  
  <pre><code>&lt;form action="Index2.php" method="POST"&gt;
      &lt;p&gt;Name:&lt;/p&gt;
      &lt;input type="text" name="name"&gt;
  
      &lt;p&gt;Last Name:&lt;/p&gt;
      &lt;input type="text" name="lname"&gt;
  
      &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and this PHP file named Index2.php </p>
  
  <pre><code>&lt;?php
  
  $connection = odbc_connect("Dashboard","","") or die ("Unable to Connect to the DB");
  
  $name=$_POST['name'];
  $last_name=$_POST['lname'];
  
  $sql = "
      INSERT INTO tableone (Name, Last_Name)
      VALUES ('$name', '$last_name')
  ";
  
  odbc_exec($connection, $sql);
  ?&gt;
  </code></pre>
  
  <p>That I have tried in a separate file to make sure connects and pass the info to the database but when I run the form it does not pass the data to MS Access and shows me the PHP code on a blank page, am I missing some sort of escaping from PHP?</p>