Confirmation Page help


I am trying to make a Thank you / Confirmation page for a site Im working on. So far I have an HTML product order form with multiple text fields from which the user can choose which posts to a PHP file. This PHP file then sends an autorepsonder to the user, the data form the order form to the owner while sending the user to an HTML thank you page.

Right now the PHP file sends all variables to the owner whether blank or not. That’s ok for a back end side, but that’s not ok ot happen on the front end in teh users view. SO what I need help with is for someone to help me tweak/improve/change my code so that when the user gets the Thank you page it also confirms what they have ordered. Unlike the owners email it will not regenerate teh entire product list; it will only return to the user teh variable attached to data.

can someone please help me with this. I’ve been working and Googlilng forever it seems. I’ve attached a sample of my code.

# ----------------------------------------------------
# -----
# ----- This script was generated by PHP-Form Wizard 1.2.5 on 4/1/2008 at 9:20:11 Miller Time
# -----
# -----
# -----
# ----------------------------------------------------

// Receiving variables
$chocolate = addslashes($_POST['chocolate']);
$double_chocolate = addslashes($_POST['double_chocolate']);
$strawberry = addslashes($_POST['strawberry']);
$peach = addslashes($_POST['peach']);
$cherry = addslashes($_POST['cherry']);
$apricot = addslashes($_POST['apricot']);
$tropical_fruit_punch = addslashes($_POST['tropical_fruit_punch']);
$Delivery_Options = addslashes($_POST['Delivery_Options']);
$name_of_person_placing_order = addslashes($_POST['name_of_person_placing_order']);
$phone_number = addslashes($_POST['phone_number']);
$email_address = addslashes($_POST['email_address']);
$delivery_month = addslashes($_POST['delivery_month']);
$delivery_day = addslashes($_POST['delivery_day']);
$delivery_year = addslashes($_POST['delivery_year']);
$delivery_hour = addslashes($_POST['delivery_hour']);
$delivery_minute = addslashes($_POST['delivery_minute']);
$am_pm = addslashes($_POST['am_pm']);
$street_address_1 = addslashes($_POST['street_address_1']);
$street_address_2 = addslashes($_POST['street_address_2']);
$city = addslashes($_POST['city']);
$state = addslashes($_POST['state']);
$zip_code = addslashes($_POST['zip_code']);
$comment = addslashes($_POST['comment']);

// Validation
//Sending Email to form owner
$pfw_header = "From: $email_addressn"
  . "Reply-To: $email_addressn";
$pfw_subject = "Your Order";
$pfw_email_to = "[email protected]";
$order = "Chocolate: $chocolaten"
. "Double Chocolate: $double_chocolaten"
. "Strawberry: $strawberryn"
. "Peach: $peachn"
. "Cherry: $cherryn"
. "Apricot: $apricotn"
. "Tropical Fruit Punch: $tropical_fruit_punchn"
. "Delivery Options: $Delivery_Optionsn"
. "Name of Person Placing Order: $name_of_person_placing_ordern"
. "Phone Number: $phone_numbern"
. "Email Address: $email_addressn"
. "Delivery Month: $delivery_monthn"
. "Delivery Day: $delivery_dayn"
. "Delivery Year: $delivery_yearn"
. "Delivery Hour: $delivery_hourn"
. "Delivery Minute: $delivery_minuten"
. "Am/Pm: $am_pmn"
. "Street Address 1: $street_address_1n"
. "Street Address 2: $street_address_2n"
. "City: $cityn"
. "State: $staten"
. "Zip Code: $zip_coden"
. "Comment: $commentn";
mail($pfw_email_to, $pfw_subject ,$order ,$pfw_header ) ;

//Sending auto respond Email to visitor
$pfw_header = "From: [email protected]"
  . "Reply-To: [email protected]";
$pfw_subject = "Order Confirmation";
$pfw_email_to = "$email_address";
$pfw_message = "This is a courtesy confirmation of the order you recently placed on the website.  There is no need to respond to this email.n"
. "n"
. "Should any alterations need to be made, please call us as soon as possible at 312-333-3333 and a representative will be more than happy to assist you.n"
. "n"
. "Thank you again for your business.n" 
. "n"
. "n"
. "$order";
mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header) ;

 /* Results render as HTML */
	$results = <<<EOD
<title>Order Confirmation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
	background-color: #9ed8eb;
	font-family:Geneva, Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-style: normal;
	line-height: normal;
	font-weight: normal;
	color: #4a2300;
	text-decoration: none;

  <div align="center" style="font-weight: bold; font-size: large;">Thank you for your order!<br> A confirmation email will arrive momentarily in the email address inbox you provided in the order form.<br><br><a href=""> Return To <br /> 
echo "$results";

Store the data in an Array. Then loop through the array. If the value is empty (or zero) then don’t echo it’s data, otherwise echo it out.

Sponsor our Newsletter | Privacy Policy | Terms of Service