Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Insurance quote form

    I am not having any luck with a form I am writing for an insurance quote.
    here is the quote.html bowlfreaks.com/gbj/quote.html and here is my php.
    When submitted, it breaks to error page.
    Any thoughts?

    PHP Code:
    <?php

    $mailto 
    '***********@gmail.com' ;
    $subject "Insurance Quote" ;
    $formurl "http://bowlfreaks.com/gbj/quote.html" ;
    $errorurl "http://www.yoursite.com/error.html" ;
    $thankyouurl "http://www.yoursite.com/thankyou.html" ;
    $uself 0;
    $use_sendmailfrom 0;
    $use_webmaster_email_for_from 0;
    $use_utf8 1;
    $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" "\n" ;
    $content_type = (!isset( $use_utf8 ) || ($use_utf8 == 0)) ? 'Content-Type: text/plain; charset="iso-8859-1"' 'Content-Type: text/plain; charset="utf-8"' ;
    if (isset( 
    $use_sendmailfrom ) && $use_sendmailfrom) {

    ini_set'sendmail_from'$mailto );
    }
    $firstname addslashes($_POST['firstname']) ;
    $lastname addslashes($_POST['lastname']) ;
    $birth addslashes($_POST['birth']) ;
    $Address addslashes($_POST['Address']) ;
    $city addslashes($_POST['city']) ;
    $state addslashes($_POST['state']) ;
    $zip addslashes($_POST['zip']) ;
    $homephone addslashes($_POST['homephone']) ;
    $workphone addslashes($_POST['workphone']) ;
    $email addslashes($_POST['email']) ;
    $head addslashes($_POST['head']) ;
    $Gender addslashes($_POST['Gender']) ;
    $marital addslashes($_POST['marital']) ;
    $social addslashes($_POST['social']) ;
    $licensed addslashes($_POST['licensed']) ;
    $driven addslashes($_POST['driven']) ;
    $tickets addslashes($_POST['tickets']) ;
    $accidents addslashes($_POST['accidents']) ;
    $subject addslashes($_POST['subject']) ;
    $message addslashes($_POST['message']) ;
    $http_referrer getenv"HTTP_REFERER" );

    if (!isset(
    $_POST['email'])) {

    header"Location: $formurl" );

    exit ;
    }

    $valid_email = (preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/im'$email)) ? true false;
    $valid_firstname = (!empty($firstname)) ? true false;
    $valid_lastname = (!empty($lastname)) ? true false;
    $valid_birth = (!empty($birth)) ? true false;
    $valid_Address = (!empty($Address)) ? true false;
    $valid_city = (!empty($city)) ? true false;
    $valid_state = (!empty($state)) ? true false;
    $valid_zip = (!empty($zip)) ? true false;
    $valid_homephone = (!empty($homephone)) ? true false;
    $valid_workphone = (!empty($workphone)) ? true false;
    $valid_email = (!empty($email)) ? true false;
    $valid_head = (!empty($head)) ? true false;
    $valid_Gender = (!empty($Gender)) ? true false;
    $valid_marital = (!empty($marital)) ? true false;
    $valid_social = (!empty($social)) ? true false;
    $valid_licensed = (!empty($licensed)) ? true false;
    $valid_driven = (!empty($driven)) ? true false;
    $valid_tickets = (!empty($tickets)) ? true false;
    $valid_accidents = (!empty($accidents)) ? true false;
    $valid_message = (!empty($subject) && !empty($message)) ? true false;


    $fromemail = (!isset( $use_webmaster_email_for_from ) || ($use_webmaster_email_for_from == 0)) ? $email $mailto ;

    if (
    get_magic_quotes_gpc()) {
        
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
        while (list(
    $key$val) = each($process)) {
            foreach (
    $val as $k => $v) {
                unset(
    $process[$key][$k]);
                if (
    is_array($v)) {
                    
    $process[$key][stripslashes($k)] = $v;
                    
    $process[] = &$process[$key][stripslashes($k)];
                } else {
                    
    $process[$key][stripslashes($k)] = stripslashes($v);
                }
            }
        }
        unset(
    $process);
    }

    $messageproper =

    "This message was sent from:\n" .

    "$http_referrer\n" .

    "------------------------------------------------------------\n" .

    "First Name: $firstname\n" .
    "Last Name: $lastname\n" .
    "City: $city\n" .
    "State: $state\n" .
    "Phone: $phone\n" .
    "Email: $email\n" .
    "Website: $website\n" .
    "Subject: $subject\n" .

    "------------------------- MESSAGE -------------------------\n\n" .

    $message .

    "\n\n------------------------------------------------------------\n" ;

    $headers "From: \"$firstname\" <$fromemail>" $headersep "Reply-To: \"$firstname\" <$email>" $headersep "X-Mailer: chfeedback.php 2.15.0" $headersep 'MIME-Version: 1.0' $headersep $content_type ;

    if (
    $valid_email && $valid_firstname && $valid_lastname && $valid_city && $valid_state && $valid_message) {
    mail$mailto$subject$messageproper$headers );
    }

    else {
    header"Location: $errorurl" );
    exit ;
    }

    header"Location: $thankyouurl" );
    exit ;

    ?>

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    What error? What goes wrong?

  • #3
    New to the CF scene
    Join Date
    May 2011
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It breaks to "error" page. so it's not sending the info. So in the
    "if (get_magic_quotes_gpc()" area, I think I might have a problem

  • #4
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    You mean error.html? Did you check to see which of the validation's is failing?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •