All pastes #930718 Raw Edit

Stuff

public text v1 · immutable
·published 2008-03-06 20:08 UTC
rendered paste body
<?php
  $mail = $_POST['mail'] ;
  $message = $_POST['message'] ;
  $cname = $_POST['cname'] ;
  $ctele = $_POST['ctelephone'] ;  
  $cemail = $_POST['cemail'] ; 
  $vendorpn = $_POST['vendorpn'] ; 
  $sbillingadd = $_POST['sbillingadd'] ; 
  $sshippingadd = $_POST['sshippingadd'] ; 
  $cperson = $_POST['cperson'] ; 
  $billing = $_POST['billingsame'];  
  $shipping = $_POST['shippingsame'];  
  $selected_radio = $_POST['contactmethod'];
  $check_box = $_POST['addressame'];
  $postalcode = $_POST['postalcode'];
  $city = $_POST['city'];
  $street = $_POST['street'];
  $province = $_POST['province'];
  $fax = $_POST['faxnumber']

  
  $mailto = "kstevehan@jmcomputer.ca" ; 
  $formurl = "http://www.jmcomputer.ca/Dealer%20Form.html" ;
  $errorurl = "http://jmcomputer.ca/error.html" ;
  $thankyouurl = "http://www.jmcomputer.ca/thanks.html" ;
  


//if no company name is entered and no company email entered print an error
if (empty($cname) && empty($cemail)){
	header( "Location: $errorurl" );
	exit;
}
//if no company telephone # entered send print an error
if (empty($ctelephone)){
	header( "Location: $errorurl" );
	exit;
}
//if no company address is entered send print an error
if (empty($caddress)){
	header( "Location: $errorurl" );
	exit;
}
//if no vendor permit is entered send print an error
if (empty($vendorpn)){
	header( "Location: $errorurl" );
	exit;
//if no shipping or billing address is entered send print an error
if (empty($sbillingadd) && empty($sshippingadd)){
	header( "Location: $errorurl" );
	exit;
	
	 if(isset( $_POST['addresssame'])){ 
	  $billing =  $_POST['addresssame'];
	}else{
	  $sbillingadd = $_REQUEST['sbillingadd'] ;
	  $billing = "Billing Address is the same as the company.";
	}  
	
	if(isset( $_POST['addresssame'])){ 
	  $shipping =  $_POST['addresssame'];
	}else{
	  $sshippingadd = $_REQUEST['sshippingadd'] ; 
	  $shipping = "Shipping Address is the same as the company.";
	} 
  
 
$messageproper =

	"-------------- Company Information --------------\n\n"
	
	"Name: $cperson\n" 
	"Email: $cemail\n"
	"Company Name: $cname\n"
	"Address: $province\n $street\n $postalcode \n $city\n" 
    "Shipping Address: $sshippingadd\n" 
	"Billing Address: $sshippingadd\n" 
	"Phone # : $ctele\n".
	"Phone # : $fax\n".

	"-------------- Contact Information --------------\n\n" .
	
 	"Contact Name: $cperson\n"
	"Contact Email: $mail\n"
	"Best way to contact: $selected_radio\n"
	
	
	"-------------- Shipping & Billing --------------\n\n" .
 	"Shipping Address is: $shipping"
	"Billing Address is: $billing"
 


	 
mail( "$mailto", "Feedback Form Results", "$messageproper",
  "From: $name <$email>" );
header( "Location: http://www.jmcomputer.ca/thanks.html" );
?>