Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. <?php
  2. function showForm($error="LOGIN"){
  3. ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  5. "DTD/xhtml1-transitional.dtd">
  6. <html>
  7.  
  8. <!DOCTYPE html>
  9. <html lang="en">
  10.  
  11. <head>
  12.  
  13. </head>
  14.  
  15. <body>
  16. <style>
  17. .border {
  18. border: 1px solid black;
  19. }
  20.  
  21. .buttonfont {
  22. font-family: "Trebuchet MS";
  23. font-size: 16px;
  24. }
  25.  
  26. .hidelink {
  27. color: black;
  28. text-decoration: none;
  29. }
  30. </style>
  31. <center>
  32. <span style="font-family:Trebuchet MS"><h2>Login to Admin Panel</h2>
  33. </center>
  34.  
  35. <span style="font-family:Trebuchet MS">
  36.  
  37. <div class="border" style="margin-left: 45%; width: 20%; height: 120px;">
  38. <br>
  39.  
  40. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="pwd">
  41. &nbsp; Password
  42. <table>
  43. <tr>
  44. <td><input name="passwd" type="password"/></td>
  45. </tr>
  46. <tr>
  47. <td align="center"><br/>
  48. <input type="submit" name="submit_pwd" value="Login"/>
  49. </td>
  50. </tr>
  51. </table>
  52. </form>
  53.  
  54. </span>
  55. </div>
  56.  
  57. </body>
  58.  
  59. </html>
  60. <?php
  61. }
  62. ?>
  63. <?php
  64. $password = 'DTportal_20';
  65.  
  66. if (isset($_POST['submit_pwd'])){
  67. $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
  68.  
  69. if ($pass != $password) {
  70. showForm("Wrong password");
  71. echo "<script type=\"text/javascript\">window.alert('Incorrect Password!');
  72. window.location.href = 'admin_panel.php';</script>";
  73. exit();
  74. }
  75. } else {
  76. showForm();
  77. exit();
  78. } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement