Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #521871

    Hi All,

    I am trying to figure out a way to include in a contact form submission if the visitor found the website organically or through PPC. The website I’m recreating used this code previously:

    <?php
    
    $name = $_POST["name"];
    $phone = $_POST["phone"];
    $email = $_POST["email"];
    $message = $_POST["message"];
    $formType = $_POST["form-type"];
    
    //handle check boxes
    
    $interest = null;
    
    $pavers = isset($_POST["pavers"]);
    $design = isset($_POST["design"]);
    $water = isset($_POST["water"]);
    $turf = isset($_POST["turf"]);
    
    if($pavers){
    	$interest .= "Pavers [x] ";
    }
    if($design){
    	$interest .= "Design [x] ";
    }
    if($water){
    	$interest .= "Water Feature [x] ";
    }
    if($turf){
    	$interest .= "Turf [x] ";
    }
    
    $headers = 'From:  (Email address hidden if logged out) ';
    
    $seoData = null;
    
    if(isset($_COOKIE['PPC'])){
    	$seoData = "PPC";
    }else{
    	$seoData = "Organic";
    }
    
    if ($formType == "long"){
    	$estimateForm = "Estimate Form:\rName: $name\rPhone: $phone\rEmail: $email\rEstimate for:\r$interest\rMessage: $message\rSEO Data: $seoData";
    	$subject = "PPI Estimate Form";
    }else{
    	$estimateForm = "Short Form:\r Name: $name\rPhone: $phone\r SEO Data: $seoData";
    	$subject = "PPI Short Form";
    }
    
    			$to = join(', ', array(
    				' (Email address hidden if logged out) ',
    				' (Email address hidden if logged out) ',
    				' (Email address hidden if logged out) ',
    			));
    
    		mail($to, $subject, $estimateForm, $headers);
    
    ?>
    

    I don’t know how to read php, so I’m not sure if that helps.

    Thanks for your help!

    #521896

    Hi jesseaborden!

    This sounds pretty complex so it would be best to hire a freelancer to help you out. If you need to customize our contact form then the file your looking for is /enfold/framework/php/class-form-generator.php

    Cheers!
    Elliott

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.