Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?php
  2. if(
  3. !empty($_POST)
  4. && !empty($_POST['firstName'])
  5. && ! empty($_POST['lastName'])
  6. && ! empty($_POST['message'])
  7. ) {
  8. echo "Your Form has been successfully Sent!";
  9. }
  10. ?>
  11.  
  12. <form style="display: flex;flex-direction: column;width:400px" action="" method="POST">
  13. <div style="margin-bottom: 10px">
  14. <input type="text" name="firstName" placeholder="first name" value="<?php echo $_POST['firstName'] ?? ''; ?>">
  15. <?php
  16. if(! empty($_POST) && empty($_POST['firstName'])) {
  17. echo "</br><span style='color:red;font-style:italic'>first Name is required!</span>";
  18. }
  19. ?>
  20. </div>
  21.  
  22. <div style="margin-bottom: 10px">
  23. <input type="text" name="lastName" placeholder="last name" value="<?php echo $_POST['lastName'] ?? ''; ?>">
  24. <?php
  25. if(! empty($_POST) && empty($_POST['lastName'])) {
  26. echo "</br><span style='color:red;font-style:italic'>last Name is required!</span>";
  27. }
  28. ?>
  29. </div>
  30. <div style="margin-bottom: 10px">
  31. <textarea name="message" id="" cols="30" rows="10" placeholder="Message"><?php echo $_POST['message'] ?? ''; ?></textarea>
  32. <?php
  33. if(! empty($_POST) && empty($_POST['message'])) {
  34. echo "</br><span style='color:red;font-style:italic'>Message is required!</span>";
  35. }
  36. ?>
  37. </div>
  38.  
  39.  
  40. <button style="padding-top: 10px;padding-bottom: 10px" type="submit">Send !</button>
  41. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement