index.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. <title>Générateur de mot de passe</title>
  6. <script src="http://code.jquery.com/jquery-latest.js"></script>
  7. <script>
  8. $(document).ready(function() {
  9. $('#btn_click').on('click', function() {
  10. var url = 'index.php';
  11. $('#passgen-wrapper').load(url + ' #passgen');
  12. });
  13. });
  14. </script>
  15. </head>
  16. <body>
  17. <h1 style="text-align: center;">Générateur de mot de passe</h1>
  18. <div id="passgen-wrapper">
  19. <div id="passgen" style="text-align: center;">
  20. <?php
  21. $minuscule = array('alpha', 'bravo', 'charlie', 'delta', 'echo', 'foxtrot', 'golf', 'hotel', 'india', 'juliette', 'kilo', 'lima', 'november', 'oscar', 'papa', 'quebec', 'romeo', 'sierra', 'tango', 'uniform', 'victor', 'whisky', 'yankee', 'zulu');
  22. $majuscule = array('ALPHA', 'BRAVO', 'CHARLIE', 'DELTA', 'ECHO', 'FOXTROT', 'GOLF', 'HOTEL', 'INDIA', 'JULIETTE', 'KILO', 'LIMA', 'NOVEMBER', 'OSCAR', 'PAPA', 'QUEBEC', 'ROMEO', 'SIERRA', 'TANGO', 'UNIFORM', 'VICTOR', 'WHISKY', 'YANKEE', 'ZULU');
  23. $special = array('@', '+', '-', '&');
  24. echo $minuscule[array_rand($minuscule)];
  25. echo $majuscule[array_rand($majuscule)];
  26. echo $special[array_rand($special)];
  27. echo(rand(1,99));
  28. ?>
  29. </div>
  30. </div>
  31. <br />
  32. <div style="text-align: center;">
  33. <button type="button" id="btn_click" />Générer nouveau mot de passe</button>
  34. </div>
  35. </body>
  36. </html>