Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $form = new Form( new Validator );
- $form->add_field(
- 'Name',
- array(
- 'required' => 'Full Name is required'
- )
- );
- $form->add_field( 'Address1' );
- $form->add_field( 'Address2' );
- $form->add_field( 'City' );
- $form->add_field( 'State' );
- $form->add_field( 'ZipCode' );
- $form->add_field(
- 'Email' ,
- array(
- 'required' => 'Email Address is required',
- 'email' => 'A valid email address is required'
- )
- );
- $form->add_field( 'Phone');
- $form->add_field(
- 'Interest' ,
- array(
- 'required' => 'You must select an Area of Interest'
- )
- );
- $form->add_field( 'Comments' );
- $mail = new Mailer( $form );
- /*
- * Rendering the page
- */
- $page = new Template();
- $page->use_file( 'contact.php' );
- if ( isset( $_POST['Submit']))
- {
- $form->collect();
- if( $form->is_valid() )
- {
- $page->use_file( 'done.html' );
- $mail->send();
- }
- else
- {
- $form->populate( $page );
- }
- }
- echo $page->render();
- ?>
Add Comment
Please, Sign In to add comment