Index: trunk/docs/examples/contact_form/contact.php
===================================================================
--- trunk/docs/examples/contact_form/contact.php	(revision 404)
+++ trunk/docs/examples/contact_form/contact.php	(revision 413)
@@ -51,14 +51,5 @@
 if (!empty($_POST)) {
     // Validate submitted data.
-    $fv->notEmpty('name', sprintf(_("%s cannot be blank."), _("Name")));
-    $fv->stringLength('name', 0, 255, sprintf(_("%s must be %d-to-%d characters in length."), _("Name"), 0, 255));
-    
-    $fv->notEmpty('email', sprintf(_("%s cannot be blank."), _("Email")));
-    $fv->stringLength('email', 0, 255, sprintf(_("%s must be %d-to-%d characters in length."), _("Email"), 0, 255));
-    $fv->validateEmail('email');
-    
-    $fv->notEmpty('message', sprintf(_("%s cannot be blank."), _("Message")));
-    $fv->stringLength('message', 0, 32000, sprintf(_("%s must be %d-to-%d characters in length."), _("Message"), 0, 32000));
-        
+    validateInput();
 	if ($fv->anyErrors()) {
         // Re-populate form values with the user data so they can make corrections.
@@ -68,12 +59,12 @@
         $email = new Email(array(
             'to' => $email_to,
-            'from' => sprintf('%s <%s>', $frm['name'], $frm['email']),
+            'from' => sprintf('%s <%s>', getFormData('name'), getFormData('email')),
             'subject' => 'Contact form email',
         ));
         $email->setTemplate('contact.eml');
         $email->replace(array(
-            'name' => $frm['name'],
-            'email' => $frm['email'],
-            'message' => $frm['question'],
+            'name' => getFormData('name'),
+            'email' => getFormData('email'),
+            'message' => getFormData('message'),
         ));
         // Send email!
@@ -113,3 +104,18 @@
 }
 
+function validateInput()
+{
+    global $fv;
+
+    $fv->notEmpty('name', sprintf(_("%s cannot be blank."), _("Name")));
+    $fv->stringLength('name', 0, 255, sprintf(_("%s must be %d-to-%d characters in length."), _("Name"), 0, 255));
+    
+    $fv->notEmpty('email', sprintf(_("%s cannot be blank."), _("Email")));
+    $fv->stringLength('email', 0, 255, sprintf(_("%s must be %d-to-%d characters in length."), _("Email"), 0, 255));
+    $fv->validateEmail('email');
+    
+    $fv->notEmpty('message', sprintf(_("%s cannot be blank."), _("Message")));
+    $fv->stringLength('message', 0, 32000, sprintf(_("%s must be %d-to-%d characters in length."), _("Message"), 0, 32000));
+}
+
 ?>
Index: trunk/docs/examples/contact_form/footer.ihtml
===================================================================
--- trunk/docs/examples/contact_form/footer.ihtml	(revision 413)
+++ trunk/docs/examples/contact_form/footer.ihtml	(revision 413)
@@ -0,0 +1,16 @@
+<div id="footer">
+    <div class="nav">
+        <a href="/one" class="first">One</a> &middot;
+        <a href="/two">Two</a> &middot;
+        <a href="/three">Three</a>
+    </div>
+    <div id="addr">
+        123 Main Street, Chico, CA 95927 â <span class="sc-email">hello at example dot com</span>
+    </div>
+</div>
+</body>
+</html>
+<?php
+// The end is nigh!
+$app->stop();
+?>
Index: trunk/docs/examples/contact_form/header.ihtml
===================================================================
--- trunk/docs/examples/contact_form/header.ihtml	(revision 413)
+++ trunk/docs/examples/contact_form/header.ihtml	(revision 413)
@@ -0,0 +1,21 @@
+<<?php echo '?xml version="1.0" encoding="' . $app->getParam('character_set') . '"?'; ?>>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <meta http-equiv="content-type" content="text/html; charset=<?php echo $app->getParam('character_set'); ?>" />
+    <title><?php printf('%s %s %s', $app->getParam('site_name'), $nav->getParam('path_delimiter'), strip_tags($nav->getPath('head_title'))) ?></title> 
+</head>
+<body<?php echo $nav->get('body_id') ? ' id="' . $nav->get('body_id') . '"' : ''; ?>>
+    <div id="header">
+        <ul class="nav">
+            <li><a href="/one" class="first">One</a></li>
+            <li><a href="/two">Two</a></li>
+            <li><a href="/three">Three</a></li>
+        </ul>
+    </div>
+    <?php if ($nav->getParam('body_title')) { ?>
+        <h1><?php echo $nav->get('body_title'); ?></h1>
+    <?php } ?>
+    <?php $app->printRaisedMessages(); ?>
+        
