add saving registrations to sqlite

This commit is contained in:
2018-02-11 20:22:40 +01:00
parent f306dda4f9
commit bd06342ccf
3 changed files with 41 additions and 5 deletions

View File

@@ -41,15 +41,22 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
}
else {
// check valid password
require_once("../database.php");
$ins_stmt->bindParam(':first_name', $first);
$ins_stmt->bindParam(':last_name', $last);
$ins_stmt->bindParam(':username', $user);
$ins_stmt->bindParam(':note', $note);
$ins_stmt->bindParam(':email', $email);
$ins_stmt->bindParam(':verify_token ', $vToken);
$first = filter_var($_POST["first_name"], FILTER_SANITIZE_STRING);
$last = filter_var($_POST["last_name"], FILTER_SANITIZE_STRING);
$user = filter_var($_POST["username"], FILTER_SANITIZE_STRING);
$pass = filter_var($_POST["password"], FILTER_SANITIZE_STRING);
$email = filter_var($_POST["email"], FILTER_VALIDATE_EMAIL);
$note = filter_var($_POST["note"], FILTER_SANITIZE_STRING);
$email = filter_var($_POST["email"], FILTER_VALIDATE_EMAIL);
$vToken= bin2hex(random_bytes(16));
$ins_stmt->execute();
$success = true;
}
if ($success) {
@@ -67,7 +74,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
} else {
$_SESSION["token"] = bin2hex(random_bytes(16));
?>
<title>Registriere dich für cg-s.tk</title>
<title>Registriere dich für <?php echo $homeserver; ?></title>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">
<style>
body{