connect_errno){ die ('Unable to connect to database [' . $db->connect_errno . ']'); } if (empty($_POST['reguser'])){ // this block contains the code to fill out the form echo '
'; include_once ('includes/account-registration.php'); echo '

'; } else { include_once ('includes/verifications.php'); // this block validates input, and if passed, inserts it into the database $hashedpass = password_hash($_POST['userpass1'], PASSWORD_DEFAULT); $stmt = $con->prepare("INSERT INTO userinfo (username, userpass, usermail) VALUES (?, ?, ?)"); $stmt->bind_param("sss", $username, $hashedpass, $verifyemail); $stmt->execute(); echo '
Account created, please login to continue

'; session_destroy(); exit(); } echo '
Back to home page
'; include_once ('footer.php'); ?>