<?php
session_start();
require_once 'connection.php';
$login = $_POST['login'];
$email = $_POST['email'];
$pass = $_POST['pass'];
$pas_con = $_POST['pass2'];
if($pass === $pas_con && $pass != "){
$passw = md5($pass);
$query = $conn->prepare("INSERT INTO users(login, email, password) VALUES(?, ?, ?)");
$query->execute([$login, $email, $passw]);
$_SESSION['message'] = 'Registration was successful! You can now log in to your account.';
header("Location: /");
}else{
$_SESSION['message'] = 'the Passwords do not match!';
header("Location: /");
}
?>
echo '<meta http-equiv="refresh" content="0;URL=/">';
//$query = $conn->prepare("INSERT INTO users(login, email, password) VALUES(?, ?, ?)");
//$query->execute([$login, $email, $passw]);
<?php header("Location /");
vs script which inhibitsFind more questions by tags PHP
Well, because he pants are still confused, take a step can't - and there, to answer with a straight face - gonzalo.Kihn commented on April 19th 20 at 12:23