itskp-odense/Backend/controller/createUser.php

19 lines
405 B
PHP
Raw Normal View History

<?php
//require our bootstrap file for database connection
require "../../bootstrap.php";
2021-06-09 10:36:09 +00:00
use Backend\Model\User;
2021-06-09 10:36:09 +00:00
//if(isset($_SESSION['permission'])){
$user = new User();
$user->name = $_POST['name'];
$hashPass = password_hash($_POST['password'], PASSWORD_DEFAULT);
$user->password = $hashPass;
if(!$user->save()){
echo "Error";
}else{
echo "saved";
}
2021-06-09 10:36:09 +00:00
//}