Show sourcecode

The following files exists in this folder. Click to view.

webbutv3/word-app/scripts/

create-user.php
index.php
initialize-db.php
insert.php
insert_page.php
test.php
translate.php

create-user.php

34 lines ASCII Windows (CRLF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
include "../include.php";

$enableCreation true// if true anyone can create a user (just for easy setup since security is not really important)

if ($enableCreation && isset($_POST["password"]) && isset($_POST["email"])) {
    
$password $_POST["password"];
    
$email $_POST["email"];
    
$passwordHash password_hash(($password), PASSWORD_DEFAULT);

    
quick_statment("INSERT INTO user (email, password_hash) VALUES(?, ?)""ss"$email$passwordHash);
}
?>


<!DOCTYPE html>
<html lang="en">

<head>
    <?php include "components/head.php" ?>
</head>

<body>
    <?php include "components/header.php"?>
    <form method="POST">
        <p>Email</p>
        <input name="email" type="text">
        <p>Password</p>
        <input name="password" type="text">
        <button>Create User</button>
    </form>
</body>

</html>