Guest User

Untitled

a guest
Mar 1st, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. 1- form login
  2. <?php
  3. $username = $_POST['username'];
  4. $password = $_POST['password'];
  5. $error ='';
  6. $sucess ='';
  7.  
  8. if(isset($_POST['submit'])){
  9. if($username =='admin'){
  10. if($password == '123'){
  11. $error = " ";
  12. $sucess = "welcome";
  13. }else{
  14. $error = "invalid password";
  15. $sucess = " ";
  16. }
  17. }else{
  18. $error = "invalid username";
  19. $sucess = " ";
  20. }
  21. }
  22. ?>
  23.  
  24. <!DOCTYPE html>
  25. <html>
  26. <head>
  27. <title>Get Your Hands Dirty: <!-- PAGE TITLE --></title>
  28. <link href="../assets/styles.css" rel="stylesheet">
  29. <style>
  30. .error{color:red;}
  31. .sucess{color:green;}
  32. </style>
  33. </head>
  34. <body>
  35. <div class="wrapper">
  36. <a href="/" title="Back to directory" id="logo">
  37. <img src="../assets/img/logo.png" alt="PHP">
  38. </a>
  39.  
  40. <h1>Get Your Hands Dirty: <small><!-- PAGE TITLE --></small></h1>
  41. <hr>
  42.  
  43. <h2>Your Example</h2>
  44.  
  45. <form name="cookieform" id="login" method="POST">
  46. <p class="error"><?php echo $error ;?></p>
  47. <p class="sucess"><?php echo $sucess; ?></p>
  48. <label for="username">User Name</label>
  49. <input type="text" name="username" id="username" class="text" maxlength="30" required />
  50. <label for="password">Password</label>
  51. <input type="text" name="password" id="password" class="text" maxlength="30" required />
  52.  
  53. <input type="submit" name="submit" value="login">
  54. </form>
  55.  
  56. <small>&copy;<!-- THIS YEAR --> - <!-- YOUR NAME --></small>
  57. </div><!-- end wrapper -->
  58.  
  59. <div class="copyright-info">
  60. <?php include('../assets/includes/copyright.php'); ?>
  61. </div><!-- end copyright-info -->
  62. </body>
  63. </html>
Add Comment
Please, Sign In to add comment