title: html form unable to submit and back to the same page
body: <p>I have this form below which is use to submit to a payment gateway. Problem is that once I click on the button, it won't go to 3rd party payment page. However, if I click second time, then it only go through? Why is that so?</p>
  
  <pre><code>&lt;form method="post" action="" name="payment"&gt;
  &lt;input type="submit" name="submit"/&gt;
  &lt;/form&gt;
  
  
  function PAYMENT_FORM($price, $username, $useremail, $usercontact, $desc, $desc2){
        //Content of the function 
  }
  
  if (isset($_POST['submit'])) {
      echo PAYMENT_FORM($cart-&gt;total, $user['firstname']." ".$user['lastname'], $user['email'], $user['telephone'], $desc, $desc2);
  }
  </code></pre>