// Remember: this widget is included by WebPageX the response array is already initiated and will be echoed by WebPageX session_start($_POST['z_session']); // this forces the session id to be the same as the session id on the remote server, (or the hub server if being served from there) if(isset($cln_tkn)){// we always send a form tkn so if there is no tkn this is just a request for the blank form. We don't check the token anymore because we don't use cookies (no session) and we've got recaptcha anyway if(array_key_exists('g-recaptcha-response',$_POST) && $_POST['g-recaptcha-response']!='')$captcha=$_POST['g-recaptcha-response'];else $captcha=false; if(1==2 && $captcha){ $secret = '6LdrHYkUAAAAAHfkZwdaQlG5e1-BAPqyncCTA8xx'; $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=.$secret.&response=".$captcha."&remoteip=".ZDEF_REQUESTING_IP); if($response.success==false){$SPAMresult='SPAM: reCaptcha Failure';} }else{ //$error='Please check the checkbox at the bottom of the form to prove you aren\'t a robot'; } ob_start(); $response=array(); // right here we check for links in the message or the name to prevent spam // $cln_message='this is the message and 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=''.$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= ''; 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); } ?>