Constantly writes that Login is busy: Here is the check from the database itself (everything works correctly, it transmits false or true)
if($_SERVER['REMOTE_ADDR'] == 'POST') { include "../conect/connection.php"; include "../functions/functions.php"; $login = clear_string($_POST['reg_login']); $result = mysql_query("SELECT login FROM reg_user WHERE login = '".$login."' "); if (mysql_num_rows($result) > 0) { echo 'false'; } else { echo 'true'; } } but still writes that the login is busy, even if the handler reported that it is not in the database
$(document).ready(function() { $('#form_reg').validate({ // ΠΏΡΠ°Π²ΠΈΠ»Π° Π΄Π»Ρ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ rules: { "reg_login": { required: true, minlength: 5, maxlength: 15, remote: { type: 'post', url: "reg/check_login.php" } }, "reg_pass": { required: true, minlength: 7, maxlength: 15 }, "reg_surname": { required: true, minlength: 3, maxlength: 15 }, "reg_name": { required: true, minlength: 3, maxlength: 15 }, "reg_patronymic": { required: true, minlength: 3, maxlength: 25 }, "reg_email": { required: true, email: true }, "reg_phone": { required: true }, "reg_address": { required: true }, "reg_captcha": { required: true, remote: { type: "post", url: "reg/check_captcha.php" } } }, // Π²ΡΠ²ΠΎΠ΄ΠΈΠΌΡΠ΅ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ ΠΏΡΠΈ Π½Π°ΡΡΡΠ΅Π½ΠΈΠΈ ΡΠΎΠΎΡΠ²Π΅ΡΡΡΠ²ΡΡΡΠΈΡ
ΠΏΡΠ°Π²ΠΈΠ» messages: { "reg_login": { required: "Π£ΠΊΠ°ΠΆΠΈΡΠ΅ ΠΠΎΠ³ΠΈΠ½!", minlength: "ΠΡ 5 Π΄ΠΎ 15 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!", maxlength: "ΠΡ 5 Π΄ΠΎ 15 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!", remote: "ΠΠΎΠ³ΠΈΠ½ Π·Π°Π½ΡΡ!" }, "reg_pass": { required: "Π£ΠΊΠ°ΠΆΠΈΡΠ΅ ΠΠ°ΡΠΎΠ»Ρ!", minlength: "ΠΡ 7 Π΄ΠΎ 15 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!", maxlength: "ΠΡ 7 Π΄ΠΎ 15 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!" }, "reg_surname": { required: "Π£ΠΊΠ°ΠΆΠΈΡΠ΅ Π²Π°ΡΡ Π€Π°ΠΌΠΈΠ»ΠΈΡ!", minlength: "ΠΡ 3 Π΄ΠΎ 20 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!", maxlength: "ΠΡ 3 Π΄ΠΎ 20 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!" }, "reg_name": { required: "Π£ΠΊΠ°ΠΆΠΈΡΠ΅ Π²Π°ΡΠ΅ ΠΠΌΡ!", minlength: "ΠΡ 3 Π΄ΠΎ 15 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!", maxlength: "ΠΡ 3 Π΄ΠΎ 15 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!" }, "reg_patronymic": { required: "Π£ΠΊΠ°ΠΆΠΈΡΠ΅ Π²Π°ΡΠ΅ ΠΡΡΠ΅ΡΡΠ²ΠΎ!", minlength: "ΠΡ 3 Π΄ΠΎ 25 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!", maxlength: "ΠΡ 3 Π΄ΠΎ 25 ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ²!" }, "reg_email": { required: "Π£ΠΊΠ°ΠΆΠΈΡΠ΅ ΡΠ²ΠΎΠΉ E-mail", email: "ΠΠ΅ ΠΊΠΎΡΡΠ΅ΠΊΡΠ½ΡΠΉ E-mail" }, "reg_phone": { required: "Π£ΠΊΠ°ΠΆΠΈΡΠ΅ Π½ΠΎΠΌΠ΅Ρ ΡΠ΅Π»Π΅ΡΠΎΠ½Π°!" }, "reg_address": { required: "ΠΠ΅ΠΎΠ±Ρ
ΠΎΠ΄ΠΈΠΌΠΎ ΡΠΊΠ°Π·Π°ΡΡ Π°Π΄ΡΠ΅Ρ Π΄ΠΎΡΡΠ°Π²ΠΊΠΈ!" }, "reg_captcha": { required: "ΠΠ²Π΅Π΄ΠΈΡΠ΅ ΠΊΠΎΠ΄ Ρ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΈ!", remote: "ΠΠ΅ Π²Π΅ΡΠ½ΡΠΉ ΠΊΠΎΠ΄ ΠΏΡΠΎΠ²Π΅ΡΠΊΠΈ!" } }, submitHandler: function(form) { $(form).ajaxSubmit({ success: function(data) { if (data == 'true') { $("#block-form-registration").fadeOut(300, function() { $("#reg_message").addClass("reg_message_good").fadeIn(400).html("ΠΡ ΡΡΠΏΠ΅ΡΠ½ΠΎ Π·Π°ΡΠ΅Π³ΠΈΡΡΡΠΈΡΠΎΠ²Π°Π½Ρ!"); $("#form_submit").hide(); }); } else { $("#reg_message").addClass("reg_message_error").fadeIn(400).html(data); } } }); } }); }); Here is the connection to the database
$connection = mysql_connect ("localhost", "root", ""); $db = mysql_select_db ("goodvac"); mysql_set_charset("utf8"); if(!$connection || !$db) { exit(mysql_error()); }