Guest User

Untitled

a guest
Jan 21st, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. $values = [
  3. 'orderperson',
  4. 'address',
  5. 'postnumber',
  6. 'city',
  7. 'phone',
  8. 'email'
  9. ];
  10.  
  11. $shipvalues = [
  12. 'recipient',
  13. 'address1',
  14. 'postnumber1',
  15. 'city1',
  16. 'phone1',
  17. 'email1'
  18. ];
  19.  
  20. foreach($values as $value) {
  21. if(empty($_POST[$value])) {
  22. header("Location: http://example.com?errors=true");
  23. }
  24. }
  25.  
  26. if (array_key_exists("checkbox", $_POST) && !empty($_POST['checkbox'])) {
  27. foreach ($shipvalues as $shipvalue) {
  28. if(empty($_POST[$shipvalue])) {
  29. header("Location: http://example.com?errors=true");
  30. }
  31. }
  32. }
  33.  
  34. header("Location: http://example.com");
  35. exit;
Add Comment
Please, Sign In to add comment