title: External form action. Post Validate in PHP. Without Javascript
body: <p>I have this form:</p>
  
  <pre><code>    &lt;form name="form2" method="post" action="http://1.1.101.1/reg.php"&gt;
          &lt;input id="field12" type="text" value="{$username}" name="username" maxlength="32" placeholder="Username" required="required" /&gt;
          &lt;input id="field22" type="text" value="{$password}" name="password" maxlength="32" placeholder="Password" required="required" /&gt;
          &lt;input name="checkbox" type="hidden" id="checkbox" value="checkbox" /&gt;
          &lt;input type="hidden" name="url" value=""/&gt;&lt;br/&gt;
          &lt;input type="submit" value="Connect to WiFi" name="button1" /&gt;&lt;br/&gt; 
      &lt;/form&gt;
  </code></pre>
  
  <p>the action is a external url.</p>
  
  <p>How can i check in my php when the button submit is posted (name = button1) before it goes to that url.</p>
  
  <p>Right now i have this but its not working becasuse it goes directly to the action url from the form. </p>
  
  <pre><code>if ($_SERVER['REQUEST_METHOD'] == "post") {
      var_dump($_POST);
      exit; 
  }
  </code></pre>