How can I @import the contact page

The contact page is special in two ways.

  1. You need to make sure the page has a 'php' extension.
  2. You need to insert special 'code' into it to get it to work correctly

In order for it to import properly you need to set up session variables. This is accomplished by opening the page inspector of the page that holds the @import, and adding a 'prefix' that sets up the session.

The tricky thing is the command is different for versions prior to 4.2.2 and version 4.2.2 and beyond

For versions prior to 4.2.2 you put the following

<?php session_start(); ?>

For versions after 4.2.2 you put the following

<?php
       //start session
       session_start();

       //set a key, checked in mailer, prevents against 
        //spammers trying to hijack the mailer.
       $security_token = $_SESSION['security_token'] = uniqid(rand());

       if(!isset($_SESSION['formMessage'])) $_SESSION['formMessage'] =
                                                   'Fill in the form below to send me an email.';
       if(!isset($_SESSION['formFooter'])) $_SESSION['formFooter'] = '';

       if(!isset($_SESSION['form'])) $_SESSION['form'] = array();

       function check($field, $type = "", $value = "") {
               $string = "";
               if(isset($_SESSION['form'][$field])) {
                       switch($type) {
                               case "checkbox":
                                       $string = 'checked="checked"';
                                       break;
                               case "radio":
                                       if($_SESSION['form'][$field] == $value) 
                                                $string = 'checked="checked"';
                                       break;
                               case "select":
                                       if($_SESSION['form'][$field] == $value) 
                                                $string = 'selected="selected"';
                                       break;
                               default:
                                       $string = unescape_string($_SESSION['form'][$field]);
                       }
               }
               return $string;
       }

       function unescape_string($string) {
               return stripslashes(@ html_entity_decode($string, ENT_QUOTES));
       }
?>