title: execute sql query on button click
body: <p>nw_check.php</p>
  
  <pre><code>&lt;?php
    $con = mysql_connect("localhost","root","12345");
    if (!$con)
    {
      die('Could not connect: ' . mysql_error());
    }
  ?&gt;
  
   &lt;html&gt;
   &lt;body&gt;
      &lt;form method="POST" action="nw_check_exec.php"&gt;
          &lt;input type="button" name="nw_update" value="NW_Update"/&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>nw_check_exec.php</p>
  
  <pre><code>&lt;?php
      if(isset($_POST['nw_update'])){
          echo("You clicked button one!");
          //and then execute a sql query here
      }
      else {
      echo" dhur";
      }
  ?&gt;
  </code></pre>
  
  <p>but for some reason the echo in the nw_check_exec.php is not being executed. please could you help.</p>