Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $values = [
- 'orderperson',
- 'address',
- 'postnumber',
- 'city',
- 'phone',
- 'email'
- ];
- $shipvalues = [
- 'recipient',
- 'address1',
- 'postnumber1',
- 'city1',
- 'phone1',
- 'email1'
- ];
- foreach($values as $value) {
- if(empty($_POST[$value])) {
- header("Location: http://example.com?errors=true");
- }
- }
- if (array_key_exists("checkbox", $_POST) && !empty($_POST['checkbox'])) {
- foreach ($shipvalues as $shipvalue) {
- if(empty($_POST[$shipvalue])) {
- header("Location: http://example.com?errors=true");
- }
- }
- }
- header("Location: http://example.com");
- exit;
Add Comment
Please, Sign In to add comment