The check login still a hurdle
<p>i still have a problem with my login page. the code that extracts information that we login with is the most complicated one. I have four fields in the login table in my database and they are,  it is like this:`id, username, password and usertype. i want if some one logs in to be directed to their level of privilege(using usertype) if the user is an administrator, they should be directed to the administrators page and not to a normal user's page. this code says :Parse error: syntax error, unexpected $end in C:\wamp\www\Learning\Checklogin.php  on line 65 which is at the end.it looks like this: </p>

<pre><code>enter code here
&lt;?php


       define(DOC_ROOT,dirname(__FILE__)); // To properly get the config.php file


       $username = $_POST['username']; //Set UserName
       $password = $_POST['password']; //Set Password
       $msg ='';


       if(isset($username, $password)) {


   ob_start();


  include(DOC_ROOT.'/config.php'); //Initiate the MySQL connection


// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($username);
$mypassword = stripslashes($password);
$myusername = mysqli_real_escape_string($dbC, $myusername);
$mypassword = mysqli_real_escape_string($dbC, $mypassword);

 //Selecting all from the table
 $sql="SELECT * FROM Login WHERE Username='$myusername' and Password='$mypassword'";
  $result=mysqli_query($dbC, $sql);
if(mysql_num_rows($result) == 1)
{

    $row = mysql_fetch_array($result);
     $type = $row['Type'];

    $_SESSION['Username'] = $username;
    $_SESSION['Password'] = $mypassword;
      $_SESSION['Type'] = $type;
    $_SESSION['loggedin'] = 1;
   {

  // Mysql_num_row is counting table row
  $count=mysqli_num_rows($result);


   if($type == "Admin")
      {


      header("Location: Admin.php");

      }


      else if(type == "User")
     {
    header("Location: userpage.php");
    }


    else if($type!='Admin'or'User')
                    {
    //echo'The page can not be found';
    header("location:error1.html");

            }
     else echo'sorry';

     }
  exit();
   ?&gt;
</code></pre>
