Files
goatoh_training_server/create_user.php
T
2023-07-19 22:41:41 +09:00

23 lines
543 B
PHP

<?php
require_once './db_connection.php';
require_once './modules/user.mod.php';
$chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$user = new User;
$user -> name = $_GET['name'];
$user -> pass = implode (
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 -> insert ();
echo implode (',', [$user -> id,
$user -> pass,
$user -> inheritance_code]);