i am a spammy link'; $cln_content='

'.$cln_message.' '.$cln_fullname.'

'; if(!$SPAMresult && !$error){ $forms_php_required='email_check contact_form_edit_send'; require ZDEF_PATH_TO_LIBRARY.'forms.php.php'; // this has the effect of checking all our input fields. Also, a sesssion is started if one is not already running. If no errors then the email is sent } } if(!empty($error)||!empty($warning)){ $errorReply='

'; if(!empty($error))$errorReply.='Error';if(empty($error)&&!empty($warning))$errorReply.='Warning';$errorReply.='

'.$error.$warning.'

'; $xjs[]=array( 'func'=>'ctf_err', 'parm'=>$errorReply ); $response['xjs']=$xjs; }else{ /* we just want the html echo'd into the WebPage or WebPageX response */ $required_fields=explode(',',ORG_CONTACT_REQUIRED_FIELDS); $get_fields=explode(',',ORG_CONTACT_GET_FIELDS); $cln_message='';$cln_email_address='';$cln_full_name=''; if(isset($cln_tkn)){ $output= '

We have received your message...

Thank you for contacting
'.ORG_ORGANIZATION_SHORT_NAME; if(ZDEF_TEST==1){ $output.='
Test Mode: recipients were '.$recipients.'
In production email would have gone to '.ORG_CONTACT_FORM_RECIPIENTS; } $output.= '.

'; $response['ib']=array( 'ib'=>'ctf_ib', 'html'=>$output ); }else{ $forms_php_required='token'; require ZDEF_PATH_TO_LIBRARY.'forms.php.php'; $token = md5(uniqid(rand(), true)); echo ''; echo '';// this is a signal to zvertest to expect recaptcha. We use it because not all our contact forms use recaptcha /* ====== the following first name field is to TRAP SPAM !!!!! ==============*/ echo '

'; if(in_array('full_name',$get_fields)){ $reqd=in_array('full_name',$required_fields); echo '

'; } if(in_array('email_address',$get_fields)){ $reqd=in_array('email_address',$required_fields); echo '

'; } if(in_array('message',$get_fields)){ $reqd=in_array('message',$required_fields); echo '

'; echo ''; echo '

'; } echo '
'; } } if(isset($response)){ $response['js']='ctf_ini'; header('Content-type: application/json;charset=utf-8'); $response=array('XP'=>$response); echo json_encode($response); } ?>