title: POST/GET array is empty, after form submit
body: <p>I've tried my code with POST and GET method also, but I can't see any value of these methods. After submit the form the page is refreshing but my .php file write out this: <code>Array ( )</code> </p>
  
  <p>I was looking for the value in Chrome developer tools but there is no 'Form data' inside the network tab, just general, response headers and request headers.</p>
  
  <p><a href="https://i.stack.imgur.com/kqbsU.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kqbsU.jpg" alt="enter image description here"></a></p>
  
  <p>My HTML code:</p>
  
  <pre><code>&lt;!--Modal: Login Form--&gt;
        &lt;form id="loginModal" name="loginModal" class="modal fade modal-full-height" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"
          data-backdrop="static" action="/main.php" method="POST"&gt;
            &lt;div class="modal-dialog cascading-modal" role="document"&gt;
                &lt;!--Content--&gt;
                &lt;div id="loginModalDiv" class="modal-content"&gt;
                    &lt;!--Header--&gt;
                    &lt;div class="modal-header myModalHeader"&gt;
                        &lt;h4 class="title"&gt;&lt;i class="fa fa-user-lg"&gt;&lt;/i&gt; Login:&lt;/h4&gt;
                    &lt;/div&gt;
                    &lt;!--Body--&gt;
                    &lt;div class="modal-body"&gt;
                        &lt;div class="md-form form-sm"&gt;
                            &lt;i class="fa fa-envelope prefix"&gt;&lt;/i&gt;
                            &lt;input type="text" id="logF_email" name="email" class="form-control"&gt;
                            &lt;label for="logF_email"&gt;E-mail address:&lt;/label&gt;
                        &lt;/div&gt;
  
                        &lt;div class="md-form form-sm"&gt;
                            &lt;i class="fa fa-lock prefix"&gt;&lt;/i&gt;
                            &lt;input type="password" id="logF_passw" name="password" class="form-control"&gt;
                            &lt;label for="logF_passw "&gt;Password:&lt;/label&gt;
                        &lt;/div&gt;
  
                        &lt;div class="text-center mt-2"&gt;
                            &lt;div id="errorLogin"&gt;&lt;/div&gt;
                            &lt;button id="btnLogin" type="submit" class="btn btn-default myModalBtn"&gt;Belépés &lt;i class="fa fa-sign-in ml-1"&gt;&lt;/i&gt;&lt;/button&gt;
                        &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;!--Footer--&gt;
                    &lt;div id="footerLogin" class="modal-footer"&gt;
                        &lt;div class="options text-center text-md-center mt-1"&gt;
                            &lt;p&gt;You don't have an account? &lt;a class="loginToSignUp myGreenClass" data-toggle="modal" href="#"&gt; Sign up!&lt;/a&gt;&lt;/p&gt;
                            &lt;p&gt;Forget &lt;a class="forgetPassword myGreenClass" data-toggle="modal" href="#"&gt; password?&lt;/a&gt;&lt;/p&gt;
                        &lt;/div&gt;
                        &lt;button type="button" class="btn btn-outline-default waves-effect ml-auto myModalBtn" data-dismiss="modal"&gt;Close&lt;/button&gt;
                    &lt;/div&gt;
                &lt;/div&gt;
                &lt;!--/.Content--&gt;
            &lt;/div&gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>...and the .php file:</p>
  
  <pre><code>$email =""; $password ="";
  if ($_SERVER['REQUEST_METHOD'] == 'POST'){
      print_r($_POST);
      $email     = $_POST['email'];
      $password = $_POST['password'];
      print_r($email);
      print_r($password);
      if ($email=="") {echo "&lt;br&gt; 'no data'";}
          else        {echo "Your email: ".$email;}
    }
  </code></pre>
  
  <p>I'm beginner in PHP, and form-handling, so I think I could miss something.
  I tried to avoid the trivial mistakes, therefor my code contains:</p>
  
  <ul>
  <li>action and method proprty for form</li>
  <li>name attribute for input fields</li>
  <li><code>type="submit"</code> for submit button</li>
  </ul>
  
  <p><code>if ( $_POST ){</code><br>
  <code>if (!empty($_POST)){</code></p>
  
  <p><strong>also not working</strong></p>
  
  <p>Any idea what's wrong?</p>