引継ぎコード追加

This commit is contained in:
2023-07-14 12:38:02 +09:00
parent c451fff119
commit f5b5da6332
2 changed files with 26 additions and 1 deletions
+5 -1
View File
@@ -14,5 +14,9 @@ $user -> pass = implode (
array_map (fn () => $chars[rand (0, strlen ($chars) - 1)], range (1, 8))); array_map (fn () => $chars[rand (0, strlen ($chars) - 1)], range (1, 8)));
$user -> inheritance_code = implode (array_map (fn () => rand (0, 9), range (1, 12))); $user -> inheritance_code = implode (array_map (fn () => rand (0, 9), range (1, 12)));
echo [$user -> insert () -> id]; $user -> insert ();
echo [$user -> id,
$user -> pass,
$user -> inheritance_code];
+21
View File
@@ -0,0 +1,21 @@
<?php
require_once './db_connection.php';
require_once './modules/user.mod.php';
$id = $_GET['id'];
$code = $_GET['code'];
$user = User :: find ($id);
if ($user -> inheritance_code === $code)
{
echo implode (',', [1,
$user -> name,
$user -> pass]);
}
else
echo 0;