title: How to connect to localhost/ html form directing to PHP code
body: <p>I'm trying to figure out how to connect to my localhost in order to run some php updating a local mysql server. Below is my html code containing the form, and the php im running. When i submit my form, it directs me to my php file in browser (as code). Is that supposed to happen? On top of that, my SQL database is not being updated.</p>
  
  <p>test_2232.html:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="update_2232.php" method="post"&gt;
      &lt;h3&gt;Code:&lt;/h3&gt;
      &lt;input type="text" name="officeCode"&gt;
      &lt;h3&gt;Name:&lt;/h3&gt;
      &lt;input type="text" name="name"&gt;
      &lt;input type="submit"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>update_2232.php:</p>
  
  <pre><code>&lt;?php
  //Connecting to sql db.
   mysql_connect('localhost', 'mysql_user', 'mysql_password') or die(mysql_error()); 
   mysql_select_db("test") or die(mysql_error()); 
  //Sending form data to sql db.
  mysqli_query($connect,"INSERT INTO office (officeCode, name)
  VALUES ('601', 'Boora')");
  ?&gt;
  </code></pre>
  
  <p>Thanks for any tips</p>