syntax error, unexpected ‘else’
-
i’m working on a form and added the below code but i’m geting this parse error, don’t know why
“syntax error, unexpected ‘else'”add_action("gform_pre_submission_3", "pre_submission_handler"); function pre_submission_handler($form_meta) { $saveVars = array("fname", "sname", "mail", "phone"); foreach($form_meta["fields"] as $field) { if( $field["allowsPrepopulate"] ){ if( is_array($field["inputs"]) ){ foreach($field["inputs"] as $sub){ $val = $_POST["input_" . str_replace(".", "_", $sub["id"])]; setcookie("gf_".$sub["name"], $val, time() + 31536000, COOKIEPATH, COOKIE_DOMAIN, false, true); } else { $val = $_POST["input_" . $field["id"]]; setcookie("gf_".$field["inputName"], $val, time() + 31536000, COOKIEPATH, COOKIE_DOMAIN, false, true); } } } }
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘syntax error, unexpected ‘else’’ is closed to new replies.