<?php setlocale(LC_ALL, "Rus"); error_reporting(E_ALL); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Practice</title> </head> <body> <?php $dbhost = "localhost"; $dblogin = "mysql"; $dbpass = "mysql"; $dbname = "Login"; $conn = new mysqli($dbhost,$dblogin,$dbpass); mysqli_select_db($conn,$dbname); if ($conn->connect_error) { "Failed to conect".$conn->connect_error(); } ?> <form action="index.php" method="post"> <input type="text" name="name"><br><br> <input type="password" name="pass"><br><br> <input type="email" name="email"><br><br> <input type="submit" name="do_signup"> </form> <?php $data = $_POST; if (isset($_POST['do_signup'])) { $errors = array(); if (trim($data['name']) == '') { $errors[] = "Введите логин"; } if ($data['pass'] == '') { $errors[] = "Введите пароль"; } if (trim($data['email']) == '') { $errors[] = "Введите емаил"; } if (empty($erorrs)) { $name = $data['name']; $pass = $data['pass']; $email = $data['email']; $sql = "INSERT INTO users(user_id,user_name,user_pass,user_email) VALUES (NULL,'$name','$pass','$email')"; $conn->query($sql); }else{ echo "<div id='errors' style='color:red;'>".array_shift($errors)."</div>"; }} ?> Please tell me why the check does not work. Sends even null values
empty()? - user242433empty(), I am sure that the problem is under these conditions (if ($data['pass'] == '')...- user242433