title: wordpress run php file in form action
body: <p>I am trying to re-do my site to wordpress, I have this problem. I have a form and on a submit php file runs and adds data to database. How do I run php file in wordpress?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;form method="POST" action="insert.php"&gt; 
  &lt;p&gt;
       &lt;label for="XX"&gt;XX&lt;/label&gt;
       &lt;input type="text" name="XX" id="XX"&gt;
        
        &lt;label for="X"&gt;X&lt;/label&gt;
       &lt;input type="text" name="X" id="X"&gt;
        &lt;label for="XXY"&gt;XXY&lt;/label&gt;
       &lt;input type="text" name="XXY" id="XXY"&gt;
        
  &lt;/p&gt;
      &lt;input type="submit" value="add to database"&gt;
  &lt;/form&gt;     </code></pre>
  </div>
  </div>
  </p>
  
  <p>How do I run the php insert.php file? Thank you!</p>
  
  <p>Or on the other hand, could I write in action the directory to the file? eg. wp-content/myphpfiles/insertgolf.php, would that work? Thank you, I am new to wordpress</p>