mirror of
https://github.com/tim-krehan/shopping-list.git
synced 2024-11-24 06:40:01 +01:00
15 lines
452 B
PHP
15 lines
452 B
PHP
<?php
|
|
session_start();
|
|
include $_SESSION["docroot"].'/php/connect.php';
|
|
include $_SESSION["docroot"].'/php/hash.php';
|
|
|
|
$salt = create_salt();
|
|
$password = hash_password($_POST["passwd"], $salt);
|
|
|
|
$result = $mysqli->query("INSERT INTO `users` (`username`, `password`, `salt`, `last_login`) VALUES ('".$_POST["username"]."', '".$password."', '".$salt."', CURRENT_TIMESTAMP);");
|
|
$mysqli->close();
|
|
|
|
unset($salt);
|
|
unset($password);
|
|
header("Location: /");
|
|
?>
|