http-root/app/pswd.php
2026-09-29 17:49:35 +09:00

11 lines
447 B
PHP

<?php
$_shared = $_SERVER["DOCUMENT_ROOT"] . "/templates";
$_title = "Password generator";
require "$_shared/header.php";
$str = strtr(base64_encode(random_bytes(15)), '+/', '-_');
$str[random_int(0, 19)] = random_int(0, 1) ? '-' : '_';
echo "<button onclick='navigator.clipboard.writeText(\"$str\").then(
() => { result.innerHTML = \"Copied\"; } );'>Copy</button><br>\n";
echo "<span id='result'></span>\n";
require "$_shared/footer.php";
?>