Example #1
0
 // $response = googleRecaptcha($_POST['g-recaptcha-response']);
 if (empty($email) || empty($email_confirm)) {
     $error = "noemail";
 } else {
     if (empty($contact_no)) {
         $error = "nocontactno";
     } else {
         if (!preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/i", $email) || !preg_match("/^[_a-z0-9-]+(\\.[_a-z0-9-]+)*@[a-z0-9-]+(\\.[a-z0-9-]+)*(\\.[a-z]{2,3})\$/i", $email_confirm)) {
             $error = "invalidemail";
         } else {
             if ($email != $email_confirm) {
                 $error = "bothemailsarenotsame.";
             } else {
                 //echo "here";
                 $users = new User();
                 $user = $users->findOneFrom('User', 'id=1');
                 $emailTo = $user->email;
                 //Admin Email
                 $subject = "Reservation from Tiigo Club";
                 $content_header = "You have recently submitted the reservation with the details:<br /><br />";
                 $content_admin_header = "A user had submitted the reservation with the details:<br /><br />";
                 $content = "First Name: " . $first_name . "<br />";
                 $content .= "Last Name: " . $last_name . "<br />";
                 $content .= "Email: " . $email . "<br />";
                 $content .= "Contact No: " . $contact_no . "<br />";
                 $content .= "Company Name: " . $company_name . "<br />";
                 $content .= "Country: " . $country . "<br /><br/><br/>";
                 $content .= "Event Name: " . $event_name . "<br />";
                 $content .= "Purpose: " . $purpose . "<br />";
                 $content .= "Arrival Date: " . $arrival_date . "<br />";
                 $content .= "Departure Date: " . $departure_date . "<br />";