title: Registration and login
body: <p>Im countering sort of a weird problem at this moment. I made a simple login form, it works halfway thru. You can indeed write your name in and such but once you hit the Submit button, I get some " Undefined index: nameX" symbols eventho I have added the variable for it before the function and such. </p>
  
  <p>This is the content of the sql_connection.sql (well part of it you have to see atleast)</p>
  
  <pre><code>/* Registration */
      $nameX = $_POST['name'];
  
      $query = isRegistered($_POST['name']); //this will check if they are valid or not
  
      if(isset($_POST['submit'])) {
          if(!empty($_POST['name'])) {
              if($query == true) {
                  echo "Welcome back";
              }
          }
          else {
              echo "No accounts found";
          }
      }
  
  function isRegistered($name) {
          global $handler;
  
          $query = "SELECT ID FROM players WHERE Username= '".$name."'";
  
          $result = mysqli_query($handler, $query);
  
          if(mysqli_num_rows($result) != 0) {
              while($row = mysqli_fetch_assoc($result)) {
                  return true;
              }
          }
          else {
              return false;
          }
      }
  </code></pre>
  
  <p>and this is the actual form </p>
  
  <pre><code>&lt;div id="login"&gt;
              &lt;form action="includes/sql_connection.php" method="get"&gt;
                  First name: &lt;input type="text" name="name"&gt;&lt;br&gt;
                  &lt;input id="button" type="submit" name="submit" value="Sign-Up"&gt;
              &lt;/form&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>The error</p>
  
  <blockquote>
    <p>Notice: Undefined index: name in
    C:\wamp\www\php\includes\sql_connection.php on line 101</p>
  </blockquote>
  
  <p>and the error line (line: 101)</p>
  
  <pre><code>$nameX = $_POST['name'];
  </code></pre>