problem with authorization

The problem is that you always displaced the password or login
Why?

login = 1234567890

PORT = SABEDR, which is checked in SHA1.
It looks in the cell so SHA1 (Sabedr)

    <?php
  session_start();
   require_once('select_db.php');
  $login = $_POST['login'];
   $password = $_POST['password'];
   $login = '"' . mysql_real_escape_string($login) . '"';
   $password = '"' . sha1($password) . '"';
  $row_login = 'SELECT login, type FROM datacenter WHERE login=' . $login . ' AND password =' . $password;
  $row_login = mysql_fetch_assoc(mysql_query($row_login));
      if($row_login){
  switch ( $row_login['type'] ){
    case 'teacher': 
      echo '<script>location.replace("accaunt_teacher.php");</script>'; exit;
   break;
    case 'parent': 
    echo '<script>location.replace("accaunt_parent.php");</script>'; exit;
break;
 case 'scholar': 
    echo '<script>location.replace("accaunt_scholar.php");</script>'; exit;
break;
default:
    echo '  ';
   }
 }
else 
   {
echo '      ' . '</br>';
echo $login . '</br>';
     echo sha1($password);
  }
  ?>

Answer 1

why never come the data I don’t know, but the logic after IFA lame on both legs, rewrite something like this:

// -     `login`   `type`, ..
$row_login = 'SELECT login, type FROM datacenter WHERE login=' . $login . ' AND password =' . $password;
$row_login = mysql_fetch_assoc(mysql_query($row_login)); //      
if($row_login) { //   
    switch($row_login['type']) {
       //  ...
    }
}
else {
    //      
}

Otherwise I personally do not see errors …


Answer 2

You select only Login, and try to check the type

field in Switch