JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
first stab at paypal_ipn framework
[wfpl-cms.git] / contact.php
index 769b2c5..00176d7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-# This form requires wfpl. See: http://jasonwoof.org/wfpl
+# This form requires wfpl. See: http://sametwice.com/wfpl
 
 # SETUP
 
@@ -9,8 +9,8 @@ $GLOBALS['contact_form_recipient'] = 'fixme@example.com';
 $GLOBALS['contact_robot_answer'] = 1002;
 
 
-require_once('code/wfpl/format.php');
-require_once('code/wfpl/email.php');
+require_once(DOCROOT . 'inc/wfpl/format.php');
+require_once(DOCROOT . 'inc/wfpl/email.php');
 
 function contact_get_fields() {
        $data = array();
@@ -29,14 +29,14 @@ function contact_main() {
 }
 
 function contact_main_form($id = false) {
+       $robot_correct = "" . $GLOBALS['contact_robot_answer'];
+       $robot_minus_one = "" . ($GLOBALS['contact_robot_answer'] - 1);
+       $robot_plus_one = "" . ($GLOBALS['contact_robot_answer'] + 1);
+       tem_set('robot_minus_one', $robot_minus_one);
+       tem_set('robot_plus_one', $robot_plus_one);
+
        if(isset($_POST['name'])) {
                $data = contact_get_fields();
-
-               $robot_correct = "" . $GLOBALS['contact_robot_answer'];
-               $robot_minus_one = "" . ($GLOBALS['contact_robot_answer'] - 1);
-               $robot_plus_one = "" . ($GLOBALS['contact_robot_answer'] + 1);
-               tem_set('robot_minus_one', $robot_minus_one);
-               tem_set('robot_plus_one', $robot_plus_one);
                $host = this_host();
 
                if(!$data['name'] && !$data['email'] && !$data['comments']) {
@@ -58,7 +58,7 @@ function contact_main_form($id = false) {
                                $email_template = new tem();
                                $email_template->load('contact.email.txt');
                                $email_template->sets($data);
-                               $email_template->set('$host', this_host());
+                               $email_template->set('$host', $host);
                                $message = $email_template->run();
                                $cc = '';
                                $bcc = '';