JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix robot field when haven't submitted yet
authorJason Woofenden <jason@jasonwoof.com>
Thu, 19 Jun 2014 20:24:52 +0000 (16:24 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 19 Jun 2014 20:24:52 +0000 (16:24 -0400)
contact.php

index 769b2c5..86fccb9 100644 (file)
@@ -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']) {