This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function random_password( $length = 8 ) { | |
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; | |
$password = substr( str_shuffle( $chars ), 0, $length ); | |
return $password; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @referenced https://stackoverflow.com/a/65996386/3299846 | |
* */ | |
function copyToClipboard(e) { | |
var copyText = document.getElementById(e); | |
// navigator clipboard api needs a secure context (https) | |
if (navigator.clipboard && window.isSecureContext) { | |
// navigator clipboard api method' | |
return navigator.clipboard.writeText(copyText.value); | |
} else { |
OlderNewer