title: PHP file with multiple email sending forms
body: <p>I have a page with 2 order forms - one for private ant the other for business. I need that when a person submits my form he would see a message on a page or an alert without redirecting to any other php files - everything should take place in the same file. My php file now looks something like this(it's a demo) and it doesn't work I just know that there are no php syntax errors(the problem should be with my code logic):</p>
  
  <pre><code>&lt;?php
   header('Content-type:text/html; charset=utf-8');
  
  if ($_POST['private-submit'] == 1) {
  if(isset($_POST['private'])) {
  
  /// Php mail code content
  
  
  @mail($email_to, $email_subject, $email_message, $headers);  
    $feedback = 'You have been registered!';}
  }
  
  
  
  if ($_POST['business-submit'] == 2) {
  if(isset($_POST['business'])) {
  
        /// Php mail code content
  
  
  
  @mail($email_to, $email_subject, $email_message, $headers);  
    $feedback = 'You have been registered!';}
  
  }
  ?&gt;
  
      &lt;form id="a" name="private" method="post" action="?"&gt;
  
         &lt;ul&gt; 
         &lt;li&gt; &lt;input type="text" name="private" placeholder="private*" required&gt;&lt;/li&gt;
  
          &lt;button  name="private-submit" type="submit" class="submit" value="1"&gt;Order&lt;/button&gt;
          &lt;/li&gt;
        &lt;p id="feedback"&gt;&lt;?php echo $feedback; ?&gt;&lt;/p&gt;  
  
        &lt;/ul&gt;
      &lt;/form&gt;
  
   &lt;form id="b" name="business" method="post" action="?"&gt;
  
  
         &lt;ul&gt; 
         &lt;li&gt; &lt;input type="text" name="business" placeholder="business" required&gt;&lt;/li&gt;     
  
          &lt;button  name="business-submit" type="submit"  value="2"&gt;Order&lt;/button&gt;
          &lt;/li&gt;
        &lt;p id="feedback"&gt;&lt;?php echo $feedback; ?&gt;&lt;/p&gt;
  
        &lt;/ul&gt;
      &lt;/form&gt;
  </code></pre>