title: execute php file from php form action
body: <p>How can I run php file from another php file with onclick button?</p>
  
  <p>My first.php file:</p>
  
  <pre><code>echo "&lt;form action='saveResult.php' method='post' name='Post'&gt;";
  echo "&lt;input name='Save' type='submit' value='Save Result'&gt; &lt;/p&gt;";
  </code></pre>
  
  <p>I want to run 'saveResult.php' from my first.php without redirect to 'saveResult.php' page.</p>
  
  <p>Thanks,</p>
  
  <p><strong>Edit 1:</strong>
  I try:</p>
  
  <pre><code>echo "&lt;form action='' method='POST' name='Post'&gt;";
  echo "&lt;input name='Save' type='submit' value='Save Result'&gt;";   
  echo "&lt;/form&gt;";
  if(isset($_POST['Save'])){
  require_once('saveResult.php'); // display error
  include_once('saveResult.php'); // display error
  include('saveResult.php'); // display error
  }
  </code></pre>
  
  <p>The error is:
  HTTP Error 405.0 - Method Not Allowed
  The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.</p>