Hi,

'; $status=0; $count =0; $rentaltype_key = $_POST['rentaltype']; $ip = $_SERVER['REMOTE_ADDR']; $REFERER = $_SERVER['HTTP_REFERER']; $message .= '

Order '.$today.':

'; $message .= '

IP from ['.$ip.']

'; $message .= '

Long IP from ['.ip2long($ip).']

'; $message .= '

REFERER ['.$REFERER.']

'; if($rentaltype_key == "Vehicle rental"){ //自駕租車 $strStart = $_POST['car_rental_periodfrom'].$_POST['car_rental_periodfromtime']; $strEnd = $_POST['car_rental_periodto'].$_POST['car_rental_periodtotime']; $date1=date_create($strStart); $date2=date_create($strEnd); $diff=date_diff($date1,$date2); $message .=$diff->format("%R%a day(s) %h hour(s) Booking"); } if($rentaltype_key == "Chauffeur"){ //Chauffeur $strStart = $_POST['periodfrom'].$_POST['periodfromtime']; $strEnd = $_POST['periodto'].$_POST['periodtotime']; $date1=date_create($strStart); $date2=date_create($strEnd); $diff=date_diff($date1,$date2); $message .=$diff->format("%R%a day(s) %h hour(s) Booking"); } $message .= ''; foreach ($_POST as $key => $value){ //Debug //$message .= $key.'='.$value.'
'; //End of Debug if (in_array($key,$rentaltype[$rentaltype_key])){ //$message .= "Match found"; $bg_color = $count % 2 === 0 ? "#f2f2f2" : "white"; $message .= ""; $message .= ''; if (is_array($value)){ $message .= ''; }else { $message .= ''; } $message .= ''; $count++; }; } $message .= '
'.$key.''; foreach ($value as $sub_key => $sub_value){ $message .= $sub_value.'
'; } $message .= '
'.$value.'
'; $message .= 'Ref.: '.$tid; $message .= '
Thanks'; $subject = "[Macau Order]".$today."-Rent A car Order"; if(isset($_POST)){ $captcha=$_POST['g-recaptcha-response']; $ip = $_SERVER['REMOTE_ADDR']; $secretkey = "6LcEyr0ZAAAAAF6uRV4eG2hiX2vAP9xRbAY1PNvK"; //Invisible $response=file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=".$secretkey."&response=".$captcha."&remoteip=".$ip); $responseKeys = json_decode($response,true); //Backlist ip if(strpos($_SERVER['REMOTE_ADDR'], "172.71.184") === 0){die;} if(strpos($_SERVER['REMOTE_ADDR'], "172.68.10") === 0){die;} //Test if(2 < 1) { //Production //if(intval($responseKeys["success"]) !== 1) { $status = 'err'; //echo '

Wrong captcha try again please!

'; } else { //Site captcha /* if(intval($responseKeys["success"]) !== 1) { $message .= '
ResponseKeys: Wrong captcha'; }else { $message .= '
ResponseKeys: OK captcha'; } */ //Production $smtp = new smtp('vangiek-com.mail.protection.outlook.com', '25',false,'', ''); //Test //$status = 'ok'; // Send email //info@virentacar.com.mo //Test Sender //if( $smtp->sendmail('ccvong@gmail.com', "no-reply@virentacar.com.hk", $subject, $message, "HTML")){ //Production Sender //if( $smtp->sendmail('info@virentacar.com.mo', "no-reply@virentacar.com.hk", $subject, $message, "HTML")){ if( $smtp->sendmail('vangiekcarrental@gmail.com', 'no-reply@virentacar.com.mo', $subject, $message, "HTML")){ $status = 'ok'; }else{ $status = 'err'; } } } // Output status echo $status;die; ?>