HEX
Server: Apache
System: Linux server1.panigaletech.com 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/captainschairit.com/wp-content/themes/captainschare/template-parts/thankyou-page.php
<?php
/**
 * Template Name: Thank You Page
 */
// echo '<pre>'; print_r($_GET); exit;
// session_start();
unset($_SESSION['company_info']);
unset($_SESSION['msp_chosen']);
unset($_SESSION['billing_info']);
if(isset($_GET['event_type_uuid']) && isset($_GET['event_type_name']) && isset($_GET['invitee_uuid']) && isset($_GET['invitee_email'])) {
 
  $oid = "00D1N000002J5G7";
  //create array of data to be posted
  $ch_register_first_name = $_GET['invitee_first_name'];
  $ch_register_last_name = $_GET['invitee_last_name'];
  $title = 'N/A'; //$_GET['answer_1'];
  $ch_register_phone = $_GET['text_reminder_number'];
  $ch_register_email = $_GET['invitee_email'];
  $company = 'N/A'; //$_GET['answer_2'];
  if($_GET['answer_1'] == '') {
	$lead_source = 'Website';
  } else {
	$lead_source = $_GET['answer_1'];  
  }
//   $mobile = $_GET['text_reminder_number'];

  // Salesforce Call
  $url = 'https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
  $fields = array(
          'first_name'=>urlencode($ch_register_first_name),
          'last_name'=>urlencode($ch_register_last_name),
	  	  'title'=>urlencode($title),
	      'company'=>urlencode($company),
          'email'=>urlencode($ch_register_email),
	  	  '00N1N00000Fa1h9'=>urlencode('Managed Services'),
// 	      'member_status'=>urlencode('Scheduled_Demo'),
          'phone'=>urlencode($ch_register_phone),
// 	      'mobile'=>urlencode($mobile),
	      'lead_source'=>urlencode($lead_source),
	  	  'rating'=>urlencode('5'),
          // 'mycustomefieldid' => urlencode($ch_register_dob), // custom field
          'oid' => urlencode($oid), // insert with your id
          'retURL' => urlencode('https://captainschairit.com/thank-you') // sending this just in case
          // 'debug' => '1',
          // 'debugEmail' => urlencode("shieldwatch006@gmail.com"), // your debugging email
  );
   
      //url-ify the data for the POST
      foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
      rtrim($fields_string,'&');
  
      //open connection
      $ch = curl_init();
  
      //set the url, number of POST vars, POST data
      curl_setopt($ch,CURLOPT_URL,$url);
      curl_setopt($ch,CURLOPT_POST,count($fields));
      curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
  
      curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, FALSE);
      curl_setopt($ch,CURLOPT_RETURNTRANSFER, TRUE);
      curl_setopt($ch,CURLOPT_FOLLOWLOCATION, TRUE);
  
      //execute post
      echo $result = curl_exec($ch);
      // echo '<pre>'; print_r($result); exit;
  // echo curl_errno($url) . '-' . curl_error($url);
      //close connection
      curl_close($ch);
   
  // HERE YOU CAN ADD ANY BUSINESS REQUIREMENT,
   
  //FOR EXAMPLE:
   
  //1) INSERT THE LEADS DATA TO YOUR MYSQL DATABASE
   
  //2) SEND THE EMAIL, etc
  // Custom Mail to client for request a demo
  request_a_demo_custom_response($ch_register_first_name, $ch_register_last_name, $ch_register_email);
   
}
get_header();
$page_heading = get_field('page_heading');
$thank_you_text = get_field('thank_you_text');
$thank_you_content = get_field('thank_you_content');
// echo '<pre>'; print_r($_SESSION['msp_chosen']);
?>
  <!-- Services -->
  <section class="page-section msp-menu-top" id="CompanyInfo">
    <div class="container">
      <div class="row">
        <div class="col-lg-12 text-center">
          <h2 class="heading01 mb-5"><?php echo $page_heading; ?></h2>
          <div class="text-center thank-you">
            <div class="sucess-chk mt-5 pt-5">
              <i class="fas fa-check-circle"></i>              
            </div>
            <h2 class="mb-5">Thank you</h2>
            <p class="mb-3"><?php echo $thank_you_text; ?></p>
            <p><?php echo $thank_you_content; ?></p>
          </div>
        </div>
      </div>
    </div>
  </section>
<?php
get_footer();
?>