Nathanwoodburn.github.io/scripts/form-54b5.php

56 lines
1.2 KiB
PHP
Raw Normal View History

2020-10-26 17:14:39 +11:00
<?php
require_once('FormProcessor.php');
$form = array(
'subject' => 'New Form Submission',
'email_message' => 'You have a new form submission',
'success_redirect' => '',
'email' => array(
'from' => 'noreply@njwapps.tk',
'to' => 'contact@nathanwoodburn.tk'
),
'fields' => array(
'name' => array(
'order' => 1,
'type' => 'string',
'label' => 'Name',
'required' => true,
'errors' => array(
'required' => 'Field \'Name\' is required.'
)
),
'email' => array(
'order' => 2,
'type' => 'email',
'label' => 'Email',
'required' => true,
'errors' => array(
'required' => 'Field \'Email\' is required.'
)
),
'message' => array(
'order' => 3,
'type' => 'string',
'label' => 'Message',
'required' => true,
'errors' => array(
'required' => 'Field \'Message\' is required.'
)
),
'agree' => array(
'order' => 4,
'type' => 'checkbox',
'label' => 'I accept the Terms of Service',
'required' => true,
'errors' => array(
'required' => 'Field \'I accept the Terms of Service\' is required.'
)
),
)
);
$processor = new FormProcessor();
$processor->process($form);
?>