title: How to save entries into db on submit button click only
body: <p>I have a code like this </p>
  
  <pre><code>&lt;?php
  if ( $thismemberinfo[msurf] &gt;= $msurfclicks ) {
      $sql=$Db1-&gt;query("INSERT INTO d_bonus VALUES('$userid','0.02',NOW())"); 
      echo "success";
  } else {
      echo "wrong";
  }
  ?&gt;
  &lt;form action="" method="post" name="myform"&gt;
    &lt;input type="hidden" value="123" name="match"&gt;
    &lt;input type="submit" value="Claim your daily bonus $o.o2" name="submit1"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want to save values into db after user clicks the submit button. I have been trying different approaches, but still could not get near to it.</p>
  
  <p>Any ideas/hints what I should do next or doing wrong?</p>
  
  <p>After the given suggesstion below is my code : </p>
  
  <pre><code>&lt;form action="" method="post" name="myform"&gt;
  &lt;input type="hidden" value="123" name="match"&gt;
  &lt;input type="submit" value="Claim your daily bonus $o.o2" name="submit1"&gt;
  &lt;/form&gt;
  &lt;?php
  if(isset($_REQUEST['submit1']))
  {
  echo "$thismemberinfo[msurf]";
  echo " $msurfclicks";
  if ( $thismemberinfo[msurf] &gt;= $msurfclicks ) {
        //$sql=$Db1-&gt;query("INSERT INTO d_bonus VALUES('$userid','0.02',NOW())"); 
            echo "success";
  
  }
  else
  {
  echo " not set " ;
  }
  
  }
  
  ?&gt;
  </code></pre>