title: JQuery/AJAX & PHP - Error with isset() when using .load() function
body: <p>I have a registration page on my website for which I want to implement PHP and AJAX validation. I will show template of my code (my code is much bigger) to try to explain the problem.</p>
  
  <p><strong>registration.php</strong></p>
  
  <pre><code>&lt;!DOCUMENT html&gt;
  &lt;html&gt;
   &lt;head&gt;
    &lt;script&gt;
     $(document).ready(function(){
      $("#signupForm").submit(function(event){
       event.preventDefault();
       var firstNameInput = $("#firstName").val();
       var lastNameInput = $("#firstName").val();
       $(".messageForm").load("inculdes/signup.script.php", {
        firstName: firstNameInput,
        lastName: lastNameInput
       });
      });
     });
    &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
    &lt;form id="signupForm" action="includes/signup.script.php" method="POST"&gt;
     &lt;input id="firstName" type="text" name="firstName"&gt;
     &lt;input id="firstName" type="text" name="firstName"&gt;
     &lt;button id="submit" name="submit" type="submit"&gt;Submit&lt;/button&gt;
     &lt;div class="messageForm"&gt;&lt;/div&gt;
    &lt;/form&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>signup.script.php</strong></p>
  
  <pre><code> &lt;?php
    if (isset($_POST['submit'])) {
     include "dbconn.script.php";
  
     $firstName = $_POST['firstName'];
     $lastName = $_POST['lastName'];
  
     //Validators for inputs in PHP with various error messages (1-15) and database INSERT and SELECT functions.
     ...
  
    } else {
       echo "&lt;span&gt;Error 16&lt;/span&gt;";
       exit();
      }
    }
   ?&gt;
  
   &lt;script&gt;
    // JQuery validator for inputs and CSS style changers based on errors
    ...
   &lt;/script&gt;
  </code></pre>
  
  <p>My problem is when I click Submit button, I get error message "Error 16", so my function skip whole PHP script and does not insert data into database. I concluded that the problem is because the variable <code>$_POST['submit']</code> is not set, because when I change first line of code to <code>if (!isset($_POST[submit'']))</code>, it works like charm, but I don't wanna loose ability to prevent users from type <code>signup.script.php</code> in URL field of the browser and run it. How to correct this to work? The tutorial I watched has this code and in that case it works without problem.</p>
  
  <p>P.S. I will expand my code if needed for solution of this problem, because I wanted to spare space so I gave the shorthand version of it.</p>