Transfer to git

This commit is contained in:
2026-02-03 19:37:38 -03:00
commit 35d8517e56
137 changed files with 5817 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
function isEmpty(array $array){
foreach ($array as $value => $content) {
if (empty($content)){
return true;
} else {
return false;
}
}
}
function username_taken(object $pdo, string $username){
if (username_search($pdo, $username)) {
return true;
} else {
return false;
}
}
function hash_password(string $pwd) {
$hashed_pw = password_hash($pwd,PASSWORD_BCRYPT,["cost"=>12]);
return $hashed_pw;
}
function user_register(object $pdo, string $username, string $pwd) {
user_write($pdo, $username, hash_password($pwd));
}
function print_errors(){
check_errors();
}