<?php
$mysqli = new mysqli("localhost", "id12308234_axedark13", "231923192319", "id12308234_masters");
$email = $_POST['email'];
$name = $_POST['name'];
$phone = $_POST['phone'];
$login = $_POST['login'];
$password = $_POST['password'];
if(isset( $_POST['submit'] )) //Нажатие кнопки
{
echo $email." ".$name." ".$phone." ".$login." ".$password;
$mysqli->query("INSERT INTO `masters` (`id`, `email`, `password`, `name`, `login`, `phone_number`, `rating`,
`avatar`, `photo1`, `photo2`, `photo3`, `photo4`, `photo5`, `town`, `area`) VALUES (NULL, '$email',
'$password', '$name', '$login', '$phone', '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)");
}
$mysqli->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Яндекс.Ноготочки</title>
<link rel="stylesheet" href="./css/sign-up.css">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">
</head>
<body>
<header class="header">
<h3 class="logo"><a href="./index.php">Яндекс.Ноготочки</a></h3>
</header>
<form action="register_request.php" class="container" name="sign-up" method="POST">
<h3 class="title">Регистрация</h3>
<p class="description">Продолжая регистрацию вы соглашаетесь с условиями использования сайта, а также даете согласие на обработку своих персональных данных.</p>
<input type="email" name="email" placeholder="Электронная почта" required>
<input type="text" name="name" placeholder="Имя" required>
<input type="tel" name="phone" placeholder="Телефон" required>
<input type="text" name="login" placeholder="Логин" required>
<input type="password" name="password" placeholder="Пароль" required>
<input type="password" name="submit-password" placeholder="Подтвердите пароль" required>
<p class="have-account">Уже есть аккаунт? <a href="./sign-in.php">Войти</a></p>
<button type="submit" name="submit" id="submit-button">Стать мастером</button>
</form>
<footer class="footer"></footer>
<script defer>
const form = document.getElementsByTagName("form")[0]
form.addEventListener("submit", (event) => {
const passwordInput = document.getElementsByName("password")[0]
const submitPasswordInput = document.getElementsByName("submit-password")[0]
const passwordInputValue = passwordInput.value
const submitPasswordInputValue = submitPasswordInput.value
console.log(passwordInputValue, submitPasswordInputValue)
if (passwordInputValue !== submitPasswordInputValue){
submitPasswordInput.value = ""
passwordInput.value = ""
passwordInput.focus()
event.preventDefault();
}
})
</script>
</body>
</html>
echo $email." ".$name." ".$phone." ".$login." ".$password;
$stmt = $mysqli->prepare("INSERT INTO `masters` (`id`, `email`, `password`, `name`, `login`, `phone_number`, `rating`,
`avatar`, `photo1`, `photo2`, `photo3`, `photo4`, `photo5`, `town`, `area`) VALUES (NULL, ?,
?,?,?,?, '0', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)");
$stmt->bind_param("sssss", $email, $password, $name, $login, $phone) ;
$stmt->execute();
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
var_dump($mysqli->error);