title: How can I execute a PHP function in a form action?
body: <p>I am trying to run a function from a PHP script in the form action.</p>
  <h3>My code:</h3>
  <pre><code>&lt;?php
  require_once ( 'username.php' );
  
  echo '
  &lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;username()&quot;&gt;
    &lt;p&gt;
      &lt;label&gt;
        &lt;input type=&quot;text&quot; name=&quot;textfield&quot; id=&quot;textfield&quot;&gt;
      &lt;/label&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;label&gt;
        &lt;input type=&quot;submit&quot; name=&quot;button&quot; id=&quot;button&quot; value=&quot;Submit&quot;&gt;
      &lt;/label&gt;
    &lt;/p&gt;
  &lt;/form&gt;';
  ?&gt;
  </code></pre>
  <p>I echo the form but I want the function &quot;username&quot; which is called from username.php to be executed. how can I do this in a simliar way to the above?</p>