M
M
Michael R.2016-04-07 10:40:14
PHP
Michael R., 2016-04-07 10:40:14

Safari does not pass the authorization form, what should I do?

Hello! I wrote an authorization script on the site, I go through authorization on Chrome, Firefox and IE10 - everything is fine, I log in to Safari - it says that it is allegedly authorized, but it does not let me go further, what's the problem?
PS without any problems I pass authorization in Ya.Pochta, Contact and similar services.
Authorization form code:

switch ($acting) {
  case 'authCheck':
    $id = mysql_result(mysql_query("SELECT `id` FROM `users` WHERE `login` = '$login'"), 0);
    if ($id > 0) {
      $pass = mysql_result(mysql_query("SELECT `pass` FROM `users` WHERE `id` = '$id'"), 0);
      if ($pass == md5(md5($_POST['pass']))) {
      session_start();
        // заносим данные пользователя в сессию
        $_SESSION['login'] = $login;
        $_SESSION['typeUser'] = mysql_result(mysql_query("SELECT `type` FROM `users` WHERE `id` = '$id'"), 0);
        $_SESSION['specUser'] = mysql_result(mysql_query("SELECT `spec` FROM `users` WHERE `id` = '$id'"), 0);
        $_SESSION['teamUser'] = mysql_result(mysql_query("SELECT `team` FROM `users` WHERE `id` = '$id'"), 0);
        $_SESSION['nameUser'] = mysql_result(mysql_query("SELECT `name` FROM `users` WHERE `id` = '$id'"), 0);
        echo "Успех!";
      } else {
        echo "Пароль не верен!";
      }
    } else {
      echo "Нет такого пользователя!";
    }
    break;
    case 'exit':
      session_destroy();
      break;

  default:
    echo '<form name="formAuth" action="?act=authCheck" method="POST">
        Логин: <input type="text" name="login" value="Логин" /><br />
        Пароль: <input type="password" name="pass" value="Пароль" /><br />
        <input type="submit" name="submitAuthCheck" value="Вход" />
      </form>';
    break;
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question