I am authorizing users and I can not understand what the error is? I rewrote the code a hundred times - always the same error - Invalid login or password, although that's right!
<?php mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("iv-data") or die(mysql_error()); if(isset($_POST["submit"])) { $user_login = strtolower(mysql_real_escape_string(trim($_POST["user_login"]))); $user_password = mysql_real_escape_string(md5(md5(trim($_POST["user_password"])))); $query = mysql_query("SELECT * FROM users WHERE user_login='$user_login'"); $user_data = mysql_fetch_array($query); if($user_data["user_password"] == $user_password){ echo "Вы вошли"; }else{ echo "Неверный логин или пароль"; } print_r($user_data); } ?> <form action="" method="POST"> <input type="text" name="user_login"> <input type="password" name="user_password"> <input type="submit" name="submit"> </form>