From: Jason Woofenden Date: Thu, 19 Jun 2014 20:24:52 +0000 (-0400) Subject: fix robot field when haven't submitted yet X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=4b384795e53cbbe789739bdc91e704803809c110;p=wfpl-cms.git fix robot field when haven't submitted yet --- diff --git a/contact.php b/contact.php index 769b2c5..86fccb9 100644 --- a/contact.php +++ b/contact.php @@ -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']) {