This code will allow you to create and modify a password generator in case you should need to quickly create a password.
<?php //********************************************************************************* //***** RANDOM PASSWORD GENERATOR - WORKS WITH NCO/REG/SYSTEMS ***** //********************************************************************************* /** * @name PassGen * @package testscripts.localdev * @version 0.1.4 * @since 12-Jul-2021 * @author Chris Appleton * @abstract Random Password Generator */ // PASSWORD GEN FOR TESTING // NO REAL FURTHER EXPLANATION NEEDED echo "Refresh the page to generate a new password.\n\n"; function rand_password($length){ $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; // ALPHABETIC CHARACTERS ALLOWED TO USE $chars .= '0123456789' ; // NUMERIC CHARACTERS IN USE $chars .= '!@#%&*()_?;:=+'; // SPECIAL CHARACTERS THAT THE FORM CAN USE (REMOVED A FEW SUCH AS []{}) $str = ''; $max = strlen($chars) - 1; for ($i=0; $i < $length; $i++) $str .= $chars[rand(0, $max)]; return $str; } echo rand_password(10); // CHANGE THIS NUMBER IF YOU WANT TO SET A LONGER OR SHORTER PASSWORD. ?>
Use notepad to save this code as something like passgen.php and upload to the webserver. Visiting domain.com/passgen.php will automatically create a new password for you to use.
A working example of this can be found here: https://tech.chrisapp.co.uk/PHP/passgen.php