Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. ?>
  5. <html>
  6. <head>
  7.  
  8. <title>zadane</title>
  9. <meta charset="utf-8"/>
  10. <link rel="stylesheet" href="style2667.css" type="text/css"/>
  11.  
  12. </head>
  13. <body>
  14.  
  15. <form method="POST">
  16.  
  17. Adres e-mail: <input type="text" name="email" required="true" pattern="^[a-zA-Z][a-zA-Z0-9-_.]{1,}@[a-zA-Z]{1,}.[a-zA-Z]{2,3}"/></br>
  18. Hasło: <input type="password" name="passwd" required="true" value="" pattern="{8,}"/></br>
  19. <input type="submit" name="submit" value="Zaloguj"/>
  20.  
  21. </form>
  22.  
  23. <?php
  24.  
  25.  
  26.  
  27.  
  28. $poprawny_email = "kjtn.mielcarek@gmail.com";
  29. $poprawne_passwd = "haslo123";
  30.  
  31.  
  32.  
  33. if(isSet($_POST['email']) && isSet($_POST['passwd']))
  34. {
  35. if (!isset($_SESSION["proby"]))
  36. $_SESSION["proby"] = 0;
  37.  
  38. echo $_SESSION["proby"];
  39. if ($_SESSION["proby"] <= 3)
  40. {
  41. $email = ($_POST["email"]);
  42. $passwd = ($_POST["passwd"]);
  43.  
  44. if($email == $poprawny_email && $passwd == $poprawne_passwd)
  45. {
  46. echo "Hasło poprawne!";
  47. }
  48. else
  49. {
  50. echo "Hasło niepoprawne";
  51. $_SESSION["proby"] = $_SESSION["proby"] + 1;
  52. }
  53.  
  54. }
  55. else
  56. {
  57. echo "Za dużo nieudanych prób";
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement