title: Create a simple login Page problems
body: <p>For an exercise I am trying to create a login page. This is my first experience with php. I have been looking at many guides and looked at many questions from stackoverflow. So this is what I came up with.(I am using XAMPP for the Database)</p>
  
  <p>Folder php: login.php, session.php, welcome.php, Connection.php</p>
  
  <p>Folder pages: login.html</p>
  
  <p>DB Name: leftoveryouth</p>
  
  <p>Table Name: clients</p>
  
  <p>Colums:id, FirstName, lastname, birthdate, street, streetnr, city, plz, username, email, Password</p>
  
  <p>Relevant HTML Code:</p>
  
  <pre><code>&lt;div class="placeholder"&gt;
                      &lt;h1 class="logo"&gt;&lt;a href="/index.html"class="alogo"&gt;Leftover Youth&lt;/a&gt;&lt;/h1&gt;
                      &lt;img class="logoo" src="../img/logoo.png" alt="firstimage"&gt;
                  &lt;form class="form" action = "" method = "post"&gt;
                      &lt;hr class="verticalline"&gt;
                      &lt;input id="email" type="text" value="Email@address.com" 
                              onblur="this.value'Email@address.com:this.value;"
                              onfocus="this.select()"
                              onclick="if (this.value=='Email@address.com'){this.value=''; this.type='Email@address.com'}"/&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;input id="password" value="Password"
                              onblur="this.value'Password:this.value;"
                              onfocus="this.select()"
                              onclick="if (this.value=='Password'){this.value=''; this.type='password'}"/&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;br&gt;
                      &lt;input id="button" type="submit" value="Log In"&gt;
                      &lt;div class="links"&gt;
                          &lt;a href="forgotpd.html" class="forpassword"&gt;Forgot Password?&lt;/a&gt;
                          &lt;a href="register.html" class="wannaregister"&gt;Create an Account?&lt;/a&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>connection.php:</p>
  
  <pre><code>&lt;?php
     define('DB_SERVER', 'localhost');
     define('DB_USERNAME', 'root');
     define('DB_PASSWORD', '');
     define('DB_DATABASE', 'leftoveryouth');
     $db = mysqli_connect(DB_SERVER,DB_USERNAME,DB_PASSWORD,DB_DATABASE);
  ?&gt;
  </code></pre>
  
  <p>session.php:</p>
  
  <pre><code>&lt;?php
     include('connection.php');
     session_start();
  
     $user_check = $_SESSION['login_user'];
  
     $ses_sql = mysqli_query($db,"select username from clients where username = '$user_check' ");
  
     $row = mysqli_fetch_array($ses_sql,MYSQLI_ASSOC);
  
     $login_session = $row['username'];
  
     if(!isset($_SESSION['login_user'])){
        header("location:login.php");
     }
  ?&gt;
  </code></pre>
  
  <p>login.php:</p>
  
  <pre><code>&lt;?php
     include("connection.php");
     include("/pages/login.html");
     session_start();
  
     if($_SERVER["REQUEST_METHOD"] == "POST") {
        // username and password sent from form 
  
        $myusername = mysqli_real_escape_string($db,$_POST['username']);
        $mypassword = mysqli_real_escape_string($db,$_POST['password']); 
  
        $sql = "SELECT id FROM clients WHERE username = '$myusername' and password = '$mypassword'";
        $result = mysqli_query($db,$sql);
        $row = mysqli_fetch_array($result,MYSQLI_ASSOC);
        $active = $row['active'];
  
        $count = mysqli_num_rows($result);
  
        // If result matched $myusername and $mypassword, table row must be 1 row
  
        if($count == 1) {
           session_register("myusername");
           $_SESSION['login_user'] = $myusername;
  
           header("location: welcome.php");
        }else {
           $error = "Your Login Name or Password is invalid";
        }
     }
  ?&gt;
  </code></pre>
  
  <p>welcome.php:</p>
  
  <pre><code>&lt;?php
     include('session.php');
  ?&gt;
  
      &lt;html&gt;
         &lt;head&gt;
            &lt;title&gt;Welcome &lt;/title&gt;
         &lt;/head&gt;
  
         &lt;body&gt;
            &lt;h1&gt;Welcome &lt;?php echo $login_session; ?&gt;&lt;/h1&gt; 
            &lt;h2&gt;&lt;a href = "logout.php"&gt;Sign Out&lt;/a&gt;&lt;/h2&gt;
         &lt;/body&gt;
  
      &lt;/html&gt;
  </code></pre>
  
  <p>I always get this Error code:</p>
  
  <pre><code> Cannot POST /pages/login.html
  </code></pre>
  
  <p>I don't care about Security at the moment. I will care about that after the basic login works:)
  So does somebody know what I have done wrong?</p>
  
  <p>-------------EDIT:--------------------
  Errors:Warning: include(/left_over_youth_website/php/connection.php): failed to open stream: No such file or directory in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 2</p>
  
  <p>Warning: include(): Failed opening '/left_over_youth_website/php/connection.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 2</p>
  
  <p>Warning: include(/left_over_youth_website/pages/login.html): failed to open stream: No such file or directory in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 3</p>
  
  <p>Warning: include(): Failed opening '/left_over_youth_website/pages/login.html' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 3</p>
  
  <p>Notice: Undefined variable: db in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 9</p>
  
  <p>Notice: Undefined index: username in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 9</p>
  
  <p>Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 9</p>
  
  <p>Notice: Undefined variable: db in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 10</p>
  
  <p>Notice: Undefined index: password in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 10</p>
  
  <p>Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 10</p>
  
  <p>Notice: Undefined variable: db in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 13</p>
  
  <p>Warning: mysqli_query() expects parameter 1 to be mysqli, null given in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 13</p>
  
  <p>Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 14</p>
  
  <p>Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\Left_over_youth_website\php\logins.php on line 17</p>