yeahhub

index.php

Dec 23rd, 2020
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <script src="./jquery.js"></script>
  6. <script type="text/javascript" src="./jquery.base64.min.js"></script>
  7. </head>
  8. <body>
  9.  
  10. <form method="POST" class="login-form" action="">
  11. <input type="text" name="email">
  12. <br>
  13. <input type="password" name="password">
  14. <br>
  15. <button type="submit" class="submit" name="submit">Login</button>
  16. </form>
  17.  
  18. <?php
  19. if (isset($_POST) && !empty($_POST)) {
  20. echo '<pre>';
  21. print_r($_POST);
  22. echo '</pre>';
  23. echo 'Encrypted Password- ' . $_POST['password'];
  24. echo '<br/>';
  25. echo 'Password- ' . base64_decode($_POST['password']);
  26. }
  27. ?>
  28. <script type="text/javascript">
  29. $(document).ready(function() {
  30. $('button.submit').on('click', function(e) {
  31. var form = $(this).parents('form');
  32. var passwordField = $(form).find('input[type="password"]');
  33. var password = $(passwordField).val();
  34. var encPassword = $.base64.encode(password);
  35. $(passwordField).val(encPassword);
  36. });
  37. });
  38. </script>
  39. </body>
  40. </html>
Add Comment
Please, Sign In to add comment