title: how to pass parameter to php function and call in html
body: <p>I have this function in php; a separate file, <code>function dbRowInsert($table_name, $form_data)</code>. </p>
  
  <p>I included it in my php file in which registration happens. My problem is how do I call the function on form submit and pass a parameter to the <code>dbRowInsert</code> function. This is the data of my form:</p>
  
  <pre><code>$form_data = array(
      'username' =&gt; $username,
      'password' =&gt; $password,
      'title' =&gt; $title,
      'first_name' =&gt; $first_name,
      'middle_name' =&gt; $middle_name,
      'last_name' =&gt; $last_name,
      'position' =&gt; $position,
      'residence' =&gt; $residence,
      'monthly_salary' =&gt; $monthly_salary,
  );  
  </code></pre>
  
  <p>I tried this method:</p>
  
  <pre><code>&lt;form id="signup_form" class="form-horizontal" role="form" action="&lt;?php dbRowInsert(tblperson, $form_data) ?&gt;"&gt;  
  ...
  &lt;/form&gt;
  </code></pre>