title: "Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\trial\register.php on line 104
body: <p>It says: </p>
  
  <blockquote>
    <p>Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\trial\register.php on line 104 </p>
  </blockquote>
  
  <p><strong>when I do localhost/trial/register.php</strong>
      line 104 is the line where my html tag closes. I don't know what is going on please help. I'm trying to create a registration page
       
  
  <pre><code>    session_start();
      //check if logged in
      if (isset($_SESSION['id'])){
          header("Location: index.php");
      }
  
      if (isset($_POST['register'])){
          include_once("db.php");
  
          $username = strip_tags($_POST['username']);
          $password = strip_tags($_POST['password']);
          $password_confirm = strip_tags($_POST['password_confirm']);
          $email = strip_tags($_POST['email']);
  
          $username = stripslashes($username);
          $password = stripslashes($password);
          $password_confirm = stripslashes($password_confirm);
          $email = stripslashes($email);
  
          $username = mysqli_real_escape_string($db, $username);
          $password = mysqli_real_escape_string($db, $password);
          $password_confirm = mysqli_real_escape_string($db, $password_confirm);
          $email = mysqli_real_escape_string($db, $email);
  
          //encrypt the password
          $password = md5($password);
          $password_confirm = md5($password_confirm);
  
          //sql storage queries
          $sql_store = "INSERT into users (username, password, email) VALUES ('$username','$password','$email')";
          $sql_fetch_username = "SELECT username FROM users WHERE username='$username'";
          $sql_fetch_email = "SELECT email FROM users WHERE email='$email'";
          //setting up queries
          $query_username = mysqli_query($db, $sql_fetch_username);
          $query_email = mysqli_query($db, $sql_fetch_email);
  
          //check for matches, incomplete entry, errors or for email already in use
          if(mysqli_num_rows($query_username)){
              echo"There is already a user with that name!";
              return;
          }
  
          if($username == ""){
              echo"Please enter a username!";
              return;
          }
  
          if($password == "" || $password_confirm==""){
              echo"Please enter your password!";
              return;
          }
  
  
          if($password !=$password_confirm){
              echo"The passwords do not match!";
              return;
          }
  
  
          if (!filter_var($email, FILTER_VALIDATE_EMAIL) || $email ==""){
              echo"This email is not valid!";
              return;
          }
  
          if (mysqli_num_rows($query_email)){
              echo"That email is already in use!";
              return;
          }
  
          mysqli_query($db, $sql_store);
          header("Location: index.php");
  ?&gt; 
  
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;PQ&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
          &lt;script src="main.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;div data-role="page" id="Welcome"&gt;
              &lt;div data-role="header"&gt;
                  &lt;h1&gt;Welcome&lt;/h1&gt;                    
              &lt;/div&gt;
              &lt;div role="main" id="loginform"&gt;
                  &lt;form method="post" action="register.php" enctype="multipart/form-data"&gt;
                      &lt;input name="username" placeholder="Username" type="text"&gt;
                      &lt;input name="password" placeholder="Password" type="password"&gt;
                      &lt;input name="password_confirm" placeholder="Confirm Password" type="password"&gt;
                      &lt;input name="email" placeholder="Email address" type="text"&gt;
                      &lt;input name="register" type="submit" value="Register"&gt;
                  &lt;/form&gt; 
              &lt;/div&gt;
              &lt;div data-role="footer" data-position="fixed" data-theme="c"&gt;
                  &lt;h4&gt;(C) 2016&lt;/h4&gt;
              &lt;/div&gt;
          &lt;/div&gt;  
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>