Привет. Что дописать , чтобы регистрация начала работать с бд?
<div class="form_modal">
<p class="password_error">Пароли не совпадают</p>
<p class="email_error">Введите корректный email</p>
<p class="reg_success">Регистрация завершена</p>
<form class="form form_registration" method="POST" action="reg_user">
<h4 class="form_title">Регистрация</h4>
<div class="form_fields">
<div class="form_field">
<label>
<p>Имя пользователя</p>
<input type="text" name="username" placeholder="Введите имя пользователя" required>
</label>
</div>
<div class="form_field">
<label>
<p>Пароль</p>
<input class="password" type="password" name="confim_password" minlength="2" placeholder="Введите Ваш Пароль" required>
</label>
</div>
<div class="form_field">
<label>
<p>Подтверждение пароля</p>
<input class="cnf_password" type="password" name="confim_password" minlength="2" placeholder="Подтвердите Ваш пароль" required>
</label>
</div>
<div class="form_field">
<label>
<p>Адресс электронной почты</p>
<input class="reg_email" type="email" name="user_email" maxlength="40" placeholder="Введите email" required>
</label>
</div>
<div class="form_submit">
<button class="form_submit-button">Создать аккаунт</button>
</div>
</div>
</form>
<?php
$method = $_SERVER['REQUEST_METHOD'];
//Script Foreach
$c = true;
if ( $method === 'POST' ) {
$project_name = trim($_POST["project_name"]);
$admin_email = trim($_POST["admin_email"]);
$form_subject = trim($_POST["form_subject"]);
foreach ( $_POST as $key => $value ) {
if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
$message .= "
" . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
<td style='padding: 10px; border: #e9e9e9 1px solid;'><b>$key</b></td>
<td style='padding: 10px; border: #e9e9e9 1px solid;'>$value</td>
</tr>
";
}
}
} else if ( $method === 'GET' ) {
$project_name = trim($_GET["project_name"]);
$admin_email = trim($_GET["admin_email"]);
$form_subject = trim($_GET["form_subject"]);
foreach ( $_GET as $key => $value ) {
if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
$message .= "
" . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
<td style='padding: 10px; border: #e9e9e9 1px solid;'><b>$key</b></td>
<td style='padding: 10px; border: #e9e9e9 1px solid;'>$value</td>
</tr>
";
}
}
}
$message = "<table style='width: 100%;'>$message</table>";
function adopt($text) {
return '=?UTF-8?B?'.base64_encode($text).'?=';
}
$headers = "MIME-Version: 1.0" . PHP_EOL .
"Content-Type: text/html; charset=utf-8" . PHP_EOL .
'From: '.adopt($project_name).' <'.$admin_email.'>' . PHP_EOL .
'Reply-To: '.$admin_email.'' . PHP_EOL;
mail($admin_email, adopt($form_subject), $message, $headers );
?>
! function(e) { var t = {};
function n(r) { if (t[r]) return t[r].exports; var o = t[r] = { i: r, l: !1, exports: {} }; return e[r].call(o.exports, o, o.exports, n), o.l = !0, o.exports } n.m = e, n.c = t, n.d = function(e, t, r) { n.o(e, t) || Object.defineProperty(e, t, { configurable: !1, enumerable: !0, get: r }) }, n.r = function(e) { Object.defineProperty(e, "__esModule", { value: !0 }) }, n.n = function(e) { var t = e && e.__esModule ? function() { return e.default } : function() { return e }; return n.d(t, "a", t), t }, n.o = function(e, t) { return Object.prototype.hasOwnProperty.call(e, t) }, n.p = "", n(n.s = 0) }([function(e, t, n) { "use strict";
(function(e) { n(2), window.onload = function() { e(".btn-reg").click(function() { e("#modal-container").removeAttr("class").addClass("one"), e("body").addClass("modal-active") }), e(".modal-background").click(function() { e("#modal-container").addClass("out"), e("body").removeClass("modal-active") }), e(".form_registration").submit(function() { var t = e(this),
n = e(".form_registration .password").val(),
r = e(".form_registration .cnf_password").val(),
o = e(".form_registration .reg_email").val(); return n !== r ? (e(".form_modal .password_error").addClass("error_visible"), !1) : (e(".form_modal .password_error").removeClass("error_visible"), !1 === /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(o) ? (e(".form_modal .email_error").addClass("error_visible"), !1) : (e(".form_modal .email_error").removeClass("error_visible"), e.ajax({ type: "POST", url: "reg.php", data: t.serialize() }).done(function() { e(".form_modal .password_error").removeClass("error_visible"), e(".form_modal .email_error").removeClass("error_visible"), e(".reg_success").addClass("success_visible"), setTimeout(function() { t.trigger("reset"), e(".reg_success").removeClass("success_visible") }, 3e3) }), !1)) }) } }).call(this, n(1)) }, function(e, t, n) {
var r;