<?php require_once 'includes/bootstrap.php'; if($_SERVER['REQUEST_METHOD']=='POST'){ $name=mysqli_real_escape_string($conn,$_POST['name']); $phone=mysqli_real_escape_string($conn,$_POST['phone']); $email=mysqli_real_escape_string($conn,$_POST['email']); $hash=password_hash($_POST['password'],PASSWORD_DEFAULT); mysqli_query($conn,"INSERT INTO users(name,phone,email,password_hash) VALUES('$name','$phone','$email','$hash')"); $_SESSION['user_id']=mysqli_insert_id($conn); $_SESSION['user_name']=$name; redirect('account.php?lang='.$lang);} include 'includes/header.php'; ?><main class="container"><form class="auth-card" method="post"><h2>Create account</h2><input name="name" placeholder="Name" required><input name="phone" placeholder="Phone" required><input name="email" type="email" placeholder="Email" required><input name="password" type="password" placeholder="Password" required><button class="primary-btn">Register</button></form></main><?php include 'includes/footer.php'; ?>
