Question: I have a calculator form included in my sidebar, below a login form. When a user submits the login form, that action triggers the:

```
if ($_SERVER['REQUEST_METHOD'] == 'POST') {}

```

statement in my other form. I tried adding an:

```
if (isset($varOne)) {}

```

statement, using the:

```
$varOne = $_POST['varOne'];

```

from the calculator script, but that didn't work either. The calculator script continues to run if the login form is submitted. How must we stop the madness?!

Answer: 
You can combine the two:

```
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['varOne'])) {
  // calculator button was pressed
}

```

or:

```
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  if (isset($_POST['varOne'])) {
    // calculator button was pressed
  } else {
    // probably a login post
  }
}

```
A possible way to do this could be passing extra parameter via get method from `<form>` tag.

```
<form action="somefile.php?formname=login" method="post"> 

</form>

```

And for your calculator form you can put

```
 <form action="somefile.php?formname=calculator" method="post"> 

 </form>

```

Finally, on your form processing script, you can check 

```
<?php 
   if(isset($_GET['formname'])){
     if($_GET['formname']=='login'){
           //get login form fields 
          $someVar=$_POST['fieldname']; //etc etc

     }

     if($_GET['formname']=='calculator'){
           //get calculator form fields 
          $someVar=$_POST['fieldname']; //etc etc

     }

   }
?>

```