No OBD data



  • I'm registering on a php website, no mistakes are made, but I don't. I've tried different versions of the code. Versions php (Hosting) - PHP Version 5.5.26

    Code php:

    $dbhost = "localhost";
    $dblogin = "u829570674_eu";
    $dbpassword = "lfeu29";
    $dbName = "u829570674_lf";
    

    // Creat connection
    $connect = new mysqli($dbhost, $dblogin, $dbpassword, $dbName);
    // Check connection
    if($connect->connect_error){
    die("Connect error: " . $connect->connect_error);
    }
    $connect->select_db('users');

    if(isset($_POST['submit'])){
        $username = htmlspecialchars($_POST['name']);
        $surname = htmlspecialchars($_POST['surname']);
        $email = htmlspecialchars($_POST['mail']);
        $password = htmlspecialchars($_POST['password']);
        if(strlen($password) > 5){
            $password = md5($password);
            $sql = "INSERT INTO users (username, surname, email, password) VALUES ($username','$surname','$email','$password')";
            //die("INSERT INTO users ('username','surname','email','password') VALUES (".$username.",".$surname.",".$email.",".$password.")");
            echo 'Дякую за реєстрацію Yes';
        }else{
            die ('Некорректно заповненно!  No');
        }
    }
    

    Html:

       <form method="post" action="" id="form-register">
    <h2 class="title">Реєстрація</h2>
    <div class="id_info">
    <input type="text" name="name" placeholder="Iм'я" class="name" required>
    <input type="text" name="surname" placeholder="Прізвище" class="surname" required><br>
    <input type="mail" name="mail" placeholder="Ел.почта" class="email" required>
    <input type="password" name="password" placeholder="Пароль" class="password" required><br>
    </div>
    <button type="submit" name="submit" id="btn-register">Зареєструватись</button>
    </form>



  • In your code between

        $sql = "INSERT INTO users (username, surname, email, password) VALUES ($username','$surname','$email','$password')";
            //die("INSERT INTO users ('username','surname','email','password') VALUES (".$username.",".$surname.",".$email.",".$password.")");
    

    and

        echo 'Дякую за реєстрацію Yes';
    

    There's no obvious attempt to comply with the request you have in the variable $sql.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2