PC Services

 

PC Services

Contact forms to Email processing examples

Web
Email

facebook logo
Follow Us on Facebook

   Email Test Mini-site 
   The Basic Process 
   Choices of Contact Form 
    

Email Processing example - The Basic Process

The Basic Process

The process starts with the forms, which user fills in and presses Submit button to send.

The data is received by post method by the email processing script, which performs initial checks, after it has read 'conf.php' to determine which set of details to use -

  • Error if no conf.php
  • Error if invalid referer or other referer checks to stop automated stuffing
  • Error if cannot find the appropriate processing details file for that form
  • Parse and check all entries against the requirements in the processing details

Once a valid set of data is available, this is then processed and sorted into a confirmation email to be sent to the user.

If sending confirmation email is successful then safe to proceed if we cannot send a confirmation email no point clogging our mailboxes with information with invalid email addresses. So next step is add extra logging details to the message before sending to the appropriate recipient

At this stage the confirmation/Thank You messages are built and the template file is included for output of these messages

If at any time we reach an unrecoverable error then the output messages are changed to error messages to be displayed using the same template file

Three variables are set with messages from the script to pass to your own styled template page(s), these are -

  • $page_title - for HTML TITLE tag for your page and possibly main header of page
  • $page_heading - heading for actual messages below
  • $message - HTML text for the message contents success/errors

In demonstration mode the following variables are of note

  • $demo - is true for demonstration mode
  • $user_message - copy of email confirmation to user
  • $owner_message - copy of email message to owner
© 2013 onwards by PC Services, Reading UK Last Updated: 20th July 2013
If you encounter problems with this page please email your comments to webmaster