title: Call PHP Function from Action Form
body: <p>I want to consolidate my PHP files into a common class file, but I am not sure how to call the function instead of the .php page. How can I call sendEmail() in the form section of my HTML page?</p>
  
  <hr>
  
  <pre><code>HMTL
  &lt;form action="form_class.php" id="frmAirport" method="post"&gt;
  Full Name: &lt;span style="white-space: pre;"&gt; 
  &lt;/span&gt;&lt;input name="name" type="text" /&gt;&lt;br /&gt;&lt;br /&gt;
  Email Address: &lt;input name="email" type="text" /&gt;&lt;br /&gt;&lt;br /&gt;
  Subject: &lt;span style="white-space: pre;"&gt;       
  &lt;/span&gt;&lt;input name="subject" type="text" /&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;textarea id="txtComments" cols="30" rows="10"&gt;Comments&lt;/textarea&gt;&lt;br /&gt;
  &lt;input type="submit" value="Send" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;?php
  function addPerson() {
  //do stuff here 
  }
  
  function sendEmail() {
  //do some stuff here 
  
  }
  ?&gt;
  </code></pre>