index.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta content="text/html; charset=UTF-8" http-equiv="content-type">
  5. <meta name="viewport" content="width=device-width">
  6. <title>Générateur de mot de passe</title>
  7. <script src="http://code.jquery.com/jquery-latest.js"></script>
  8. <script>
  9. $(document).ready(function() {
  10. $('#btn_click').on('click', function() {
  11. var url = 'index.php';
  12. $('#passgen-wrapper').load(url + ' #passgen');
  13. });
  14. });
  15. </script>
  16. </head>
  17. <body>
  18. <h1 style="text-align: center;">Générateur de mot de passe</h1>
  19. <div id="passgen-wrapper">
  20. <div id="passgen" style="text-align: center;">
  21. <?php
  22. $minuscule = array('alpha', 'bravo', 'charlie', 'delta', 'echo', 'foxtrot', 'golf', 'hotel', 'india', 'juliette', 'kilo', 'lima', 'mike', 'november', 'oscar', 'papa', 'quebec', 'romeo', 'sierra', 'tango', 'uniform', 'victor', 'whisky', 'xray', 'yankee', 'zulu');
  23. $majuscule = array('ALPHA', 'BRAVO', 'CHARLIE', 'DELTA', 'ECHO', 'FOXTROT', 'GOLF', 'HOTEL', 'INDIA', 'JULIETTE', 'KILO', 'LIMA', 'MIKE', 'NOVEMBER', 'OSCAR', 'PAPA', 'QUEBEC', 'ROMEO', 'SIERRA', 'TANGO', 'UNIFORM', 'VICTOR', 'WHISKY', 'XRAY', 'YANKEE', 'ZULU');
  24. $special = array('@', '+', '-', '&');
  25. echo $minuscule[array_rand($minuscule)];
  26. echo $majuscule[array_rand($majuscule)];
  27. echo $special[array_rand($special)];
  28. echo(rand(1,99));
  29. ?>
  30. </div>
  31. </div>
  32. <br />
  33. <div style="text-align: center;">
  34. <button type="button" id="btn_click" />Générer nouveau mot de passe</button>
  35. <br /><br />
  36. <a href="https://gogs.am-networks.fr/AMNetworks/PasswordGenerator-PHP" target="_blank">Cliquez ici pour accéder au code source</a>
  37. </div>
  38. </body>
  39. </html>