title: Undefined index
body: <p><strong>Notice: Undefined index: Username in C:\wamp\www\CodeCanyon\MCBuddy\Global.php on line 5
   Notice: Undefined index: Password in C:\wamp\www\CodeCanyon\MCBuddy\Global.php on line 6</strong></p>
  
  <p>Here is my <strong>Global.php</strong> code:</p>
  
  <pre><code>session_id();
  session_start();
  ob_start();
  $loggedIn = $_SESSION['Username'];
  $Password = $_SESSION['Password']; 
  $CurrentTime = time();
  // MySQL Database Conection Information
  define("DBHost", "localhost"); // MYSQL Database Host
  define("DBUsername", "root"); // MYSQL Database Username
  define("DBPassword", ""); // MYSQL Database Password
  define("Database", "mcbuddy"); // MYSQL Database Name
  // Establish Connection to MYSQL Database
  $db = new mysqli(DBHost, DBUsername, DBPassword, Database);
  if ($db-&gt;connect_errno) {
      echo "Failed to connect to MySQL: (" . $db-&gt;connect_errno . ") " . $db-&gt;connect_error;
  }
  </code></pre>
  
  <p>My <strong>Login.php</strong> (I think the error is here)</p>
  
  <pre><code>&lt;?php
  require 'Global.php';
  ?&gt;
  &lt;div class='well'&gt;
  &lt;div style='text-align:center'&gt;
  &lt;h2&gt; Sign In &lt;/h2&gt;
  &lt;center&gt;
  &lt;p id='errorMsg' style='background-color: #D11124; width:300px; color:white; text-align:center;'/&gt;
  &lt;form action='' method='POST'&gt;
  &lt;input type='text' name='Username' placeholder='Username'&gt; &lt;br /&gt;
  &lt;input type='password' name='Password' placeholder='Password'&gt; &lt;br /&gt;
  &lt;input class='btn btn-xlarge' type='submit' name='signin' value='Sign In'&gt; 
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;?php
  if(isset($_REQUEST['signin'])) {
  $Username = htmlspecialchars(strip_tags($_REQUEST['Username']));
  $Password = htmlspecialchars(strip_tags($_REQUEST['Password']));
  $p1 = md5($Password);
  $UserInfo = $db-&gt;query("SELECT * FROM users WHERE Username='$Username'");
  $UserI = $UserInfo-&gt;fetch_array(MYSQLI_BOTH);
  
      if(empty($Password) || $Password == '') {
      echo "
      &lt;script type='text/javascript'&gt;
                  document.getElementById('errorMsg').innerHTML = 'Password is empty!';
      &lt;/script&gt;
      ";
      }
      elseif(empty($Username) || $Username == '') {
      echo "
      &lt;script type='text/javascript'&gt;
                  document.getElementById('errorMsg').innerHTML = 'Username is empty!';
      &lt;/script&gt;
      ";
      }
          elseif($UserI['Password'] != $p1) {
          echo "
          &lt;script type='text/javascript'&gt;
                  document.getElementById('errorMsg').innerHTML = 'Incorrect username/password';
          &lt;/script&gt;
      ";
  
         } else {
         $_SESSION['Username']=$Username;
         $_SESSION['Password']=$Password;
         }
  }
  </code></pre>