HenriqueZ

Form-check

Oct 10th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4. <head>
  5. <meta charset="UTF-8">
  6. <title>Opdracht week 6</title>
  7.  
  8. <style>
  9. form {width:600px;
  10. margin:100px;
  11. }
  12. </style>
  13. </head>
  14. <body>
  15. <?php
  16. if (isset($_GET["verstuur"])) {
  17. if ($_GET["email"] == "" || $_GET["onderwerp"] == "" || $_GET["bericht"] == "") {
  18. print("<h2>Zorg dat de verplichte velden ingevuld zijn!!</h2>");
  19. ?><form method="get" action="formulier.php">
  20. E-mailadres: <input type="text" name="email" value="<?php print($_GET["email"]) ?>">
  21. <?php
  22. if ($_GET["email"] == "") {
  23. print("Verplicht!");
  24. }
  25. ?>
  26. <br>
  27. Onderwerp: <input type="text" name="onderwerp" value="<?php print($_GET["onderwerp"]) ?>">
  28. <?php
  29. if ($_GET["onderwerp"] == "") {
  30. print("Verplicht!");
  31. }
  32. ?>
  33. <br>
  34. Bericht: <textarea name="bericht" rows="4" ><?php print($_GET["bericht"]) ?></textarea>
  35. <?php
  36. if ($_GET["bericht"] == "") {
  37. print("Verplicht!");
  38. }
  39. ?>
  40. <br>
  41. <input type="submit" name="verstuur" value="Verstuur bericht">
  42. </form><?php
  43. } else {
  44. print("Bericht wordt verzonden!!!");
  45. }
  46. } else {
  47. ?>
  48. <form method="get" action="verwerk.php">
  49. E-mailadres: <input type="text" name="email"><br>
  50. Onderwerp: <input type="text" name="onderwerp"><br>
  51. Bericht: <textarea name="bericht" rows="4"></textarea><br>
  52. <input type="submit" name="verstuur" value="Verstuur bericht">
  53. </form>
  54. <?php
  55. }
  56. ?>
  57. </body>
  58. </html>
Add Comment
Please, Sign In to add comment