Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. </head>
  5. <body>
  6. <form method="POST" action="index.php">
  7. <input placeholder="Email" type="text" name="email">
  8. <input placeholder="Age" type="text" name="age">
  9. <input placeholder="Password" type="password" name="password">
  10. <input type="submit">
  11. </form>
  12. </body>
  13. </html>
  14.  
  15. <?php
  16. $email = $_POST["email"];
  17. $age = $_POST["age"];
  18. $password = $_POST["password"];
  19.  
  20. $condition = (isset($email) && $age >= 16 && $age < 100 && strlen($password) > 5 && strlen($password) < 25);
  21.  
  22. if($condition) {
  23. $dbopen = fopen("db.txt", "a") or die("something wrong with file system...");
  24.  
  25. fwrite($dbopen, $age . "\n");
  26. fwrite($dbopen, $email . "\n");
  27. fwrite($dbopen, $password . "\n");
  28.  
  29. fclose($dbopen);
  30. echo "All right";
  31. } else {
  32. echo "WRYYYYY";
  33. }
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement