Page 1 of 1

form processing errors

Posted: Thu Nov 20, 2008 11:32 am
by someguyhere
I'm trying to make a form that processes the results, and then displays them on the same page as well as emailing a copy to an email address but I seem to have run into a raodbloack. The form processes the info and sends it to the email address, but for some reason, it never displays the info afterwards. I'm assuming I need to wrap certain parts of the script in if/then statements but I really don't see how to go about this. Any ideas? Thanks in advance!

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
 
    <style type="text/css">
    body{font:100% Arial, Helvetica, sans-serif;background-image:url(http://tranquilitycreations.com/templat ... ges/bg.jpg);background-repeat:repeat-x;background-color:#001a53;color:#ffffff;
}
    h1{font-size:160%;margin:0px 0px 25px 0px;}
    h2{font-size:100%;margin:0px 0px 5px 0px;}
    select, input{margin:5px 0px 20px 0px;}
    .container{margin:0px auto 0px auto;width:950px;}
    .form-divider{float:left;margin-right:40px;}
    </style>
 
</head>
 
<body>
 
<p><?php echo $name ?></p>
 
<?php
 
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','name');
pt_register('POST','email');
pt_register('POST','phone');
pt_register('POST','address');
pt_register('POST','city');
pt_register('POST','state');
pt_register('POST','zip');
pt_register('POST','pool_name');
pt_register('POST','pool_size');
pt_register('POST','pool_add_depth');
pt_register('POST','sun_shelf');
pt_register('POST','custom_spa');
pt_register('POST','blower_option');
pt_register('POST','pool_finish');
pt_register('POST','pool_tile');
pt_register('POST','pool_pump');
pt_register('POST','pool_filter');
pt_register('POST','sanatizer');
pt_register('POST','lighting');
pt_register('POST','heater');
pt_register('POST','automation_system');
pt_register('POST','pool_cleaning_system');
pt_register('POST','deck_size');
pt_register('POST','deck_style');
pt_register('POST','pool_edge_style');
pt_register('POST','deco_drain');
pt_register('POST','raised_deck');
pt_register('POST','raised_planter');
pt_register('POST','water_features');
pt_register('POST','screen_cage');
pt_register('POST','child_safety');
 
if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
 
function get_string_between($string, $start, $end){
   $string = " ".$string;
     $ini = strpos($string,$start);
     if ($ini == 0) return "";
     $ini += strlen($start);    
     $len = strpos($string,$end,$ini) - $ini;
     return substr($string,$ini,$len);
}
 
$pool_size_price = get_string_between($pool_size,"$",")");
$pool_size_price = str_replace(",", "", $pool_size_price);
$pool_add_depth_price = get_string_between($pool_add_depth,"$",")");
$pool_add_depth_price = str_replace(",", "", $pool_add_depth_price);
$sun_shelf_price = get_string_between($sun_shelf,"$",")");
$sun_shelf_price = str_replace(",", "", $sun_shelf_price);
$custom_spa_price = get_string_between($custom_spa,"$",")");
$custom_spa_price = str_replace(",", "", $custom_spa_price);
$blower_option_price = get_string_between($blower_option,"$",")");
$blower_option_price = str_replace(",", "", $blower_option_price);
$pool_finish_price = get_string_between($pool_finish,"$",")");
$pool_finish_price = str_replace(",", "", $pool_finish_price);
$pool_tile_price = get_string_between($pool_tile,"$",")");
$pool_tile_price = str_replace(",", "", $pool_tile_price);
$pool_pump_price = get_string_between($pool_pump,"$",")");
$pool_pump_price = str_replace(",", "", $pool_pump_price);
$pool_filter_price = get_string_between($pool_filter,"$",")");
$pool_pump_price = str_replace(",", "", $pool_pump_price);
$sanatizer_price = get_string_between($sanatizer,"$",")");
$sanatizer_price = str_replace(",", "", $sanatizer_price);
$lighting_price = get_string_between($lighting,"$",")");
$lighting_price = str_replace(",", "", $lighting_price);
$heater_price = get_string_between($heater,"$",")");
$heater_price = str_replace(",", "", $heater_price);
$automation_system_price = get_string_between($automation_system,"$",")");
$automation_system_price = str_replace(",", "", $automation_system_price);
$pool_cleaning_system_price = get_string_between($pool_cleaning_system,"$",")");
$pool_cleaning_system_price = str_replace(",", "", $pool_cleaning_system_price);
$deck_size_price = get_string_between($deck_size,"$",")");
$deck_size_price = str_replace(",", "", $deck_size_price);
$deck_style_price = get_string_between($deck_style,"$",")");
$deck_style_price = str_replace(",", "", $deck_style_price);
$pool_edge_style_price = get_string_between($pool_edge_style,"$",")");
$pool_edge_style_price = str_replace(",", "", $pool_edge_style_price);
$deco_drain_price = get_string_between($deco_drain,"$",")");
$deco_drain_price = str_replace(",", "", $deco_drain_price);
$raised_deck_price = get_string_between($raised_deck,"$",")");
$raised_deck_price = str_replace(",", "", $raised_deck_price);
$raised_planter_price = get_string_between($raised_planter,"$",")");
$raised_planter_price = str_replace(",", "", $raised_planter_price);
$water_features_price = get_string_between($water_features,"$",")");
$water_features_price = str_replace(",", "", $water_features_price);
$screen_cage_price = get_string_between($screen_cage,"$",")");
$screen_cage_price = str_replace(",", "", $screen_cage_price);
$child_safety_price = get_string_between($child_safety,"$",")");
$child_safety_price = str_replace(",", "", $child_safety_price);
 
$total = $pool_size_price + $pool_add_depth_price + $sun_shelf_price + $custom_spa_price + $blower_option_price + $pool_finish_price + $pool_tile_price + $pool_pump_price + $pool_filter_price + $sanatizer_price + $lighting_price + $heater_price + $automation_system_price + $pool_cleaning_system_price + $deck_size_price + $deck_style_price + $pool_edge_style_price + $deco_drain_price + $raised_deck_price + $raised_planter_price + $water_features_price + $screen_cage_price + $child_safety_price;
 
$total = number_format($total);
 
$message="
$name, thank you for taking the time to discuss your new Tranquility Creations pool with XYZ Builders today. Below is the information about the options that we discussed along with the investment for each option. We look forward to helping to create a Personal Resort Experience as unique as you are. If you have any questions or would like any additional information, feel free to email or give us a call anytime.
 
Contact information:\n
  $name\n
  $email\n
  $phone\n
  $address\n
  $city\n
  $state\n
  $zip\n
 
Pool options:\n
  $pool_name\n
  $pool_size\n
  $pool_add_depth\n
  $sun_shelf\n
  $custom_spa\n
  $blower_option\n
  $pool_finish\n
  $pool_tile\n
  $pool_pump\n
  $pool_filter\n
  $sanatizer\n
  $lighting\n
  $heater\n
  $automation_system\n
  $pool_cleaning_system\n
  $deck_size\n
  $deck_style\n
  $pool_edge_style\n
  $deco_drain\n
  $raised_deck\n
  $raised_planter\n
  $water_features\n
  $screen_cage\n
  $child_safety\n
 
Total investment:\n".
"
  $$total";
 
$message = stripslashes($message);
mail("$email,jlknauff@wildfiremg.com","Online Pool Quote",$message,"From: XYZ Home Builder");
 
}
 
//arrays for pool options
 
$pool_name = array(
 
    array(
        "name" => "The Brightling",
        ),
    
    array(
        "name" => "The Grecian",
        ),
 
    array(
        "name" => "The Tranquility",
        ),
 
    array(
        "name" => "The Reflection",
        ),
 
    array(
        "name" => "The Vizcaya",
        ),
 
    array(
        "name" => "The Venetian",
        ),
);
 
$pool_size = array(
 
    array(
        "name" => "12'x24' Pool Package 3'-5' Depth",
        "price" => "$28,950"
        ),
    
    array(
        "name" => "13'x26' Pool Package 3'-5' Depth",
        "price" => "$30,700"
        ),
 
    array(
        "name" => "14'x28' Pool Package 3'-5' Depth",
        "price" => "$34,750"
        ),
 
    array(
        "name" => "15'x30' Pool Package 3'-5' Depth",
        "price" => "$37,600"
        ),
);
 
$pool_add_depth = array(
 
    array(
        "name" => "Standard 3'-5' depth",
        "price" => "$0"
        ),
    
    array(
        "name" => "+1' Depth",
        "price" => "$850"
        ),
 
    array(
        "name" => "+2' Depth",
        "price" => "$1,700"
        ),
 
);
 
$sun_shelf = array(
 
    array(
        "name" => "Standard Pie Steps and Swimout",
        "price" => "$0"
        ),
    
    array(
        "name" => "Sun Shelf with Extended Steps and Bench",
        "price" => "$600"
        ),
 
);
 
$custom_spa = array(
 
    array(
        "name" => "No custom spa",
        "price" => "$0"
        ),
    
    array(
        "name" => "6' Round Spa (Does not include heater)",
        "price" => "$6,750"
        ),
 
    array(
        "name" => "Hydra Bench (Includes 4 therapy jets)",
        "price" => "$1,870"
        ),
 
);
 
$blower_option = array(
 
    array(
        "name" => "No blower",
        "price" => "$0"
        ),
    
    array(
        "name" => "Spa Air Blower",
        "price" => "$600"
        ),
 
);
 
$pool_finish = array(
 
    array(
        "name" => "Standard Marquis Finish w/ Spa",
        "price" => "$0"
        ),
    
    array(
        "name" => "Upgrade Marquis Finish w/ Spa (Charcoal, azure, dune, majestic white)",
        "price" => "$1,500"
        ),
 
    array(
        "name" => "NPT Pebble Finish w/ Spa, Whites",
        "price" => "$1,500"
        ),
 
    array(
        "name" => "NPT Pebble Finish w/ Spa (All colors but midnight)",
        "price" => "$2,500"
        ),
 
    array(
        "name" => "NPT Pebble Finish w/ Spa (Midnight)",
        "price" => "$3.000"
        ),
 
);
 
$pool_tile = array(
 
    array(
        "name" => "Standard Pool Line Title",
        "price" => "$0"
        ),
    
);
 
$pool_pump = array(
 
    array(
        "name" => "Pentair Whisperflo 1.5 HP",
        "price" => "$0"
        ),
    
    array(
        "name" => "Pentair Whisperflo 1.5 HP",
        "price" => "$300"
        ),
    
);
 
$pool_filter = array(
 
    array(
        "name" => "Pentair Clean & Clear 150 SF",
        "price" => "$0"
        ),
    
    array(
        "name" => "48 SF FNS Plus DE Filter",
        "price" => "$800"
        ),
    
);
 
$sanatizer = array(
 
    array(
        "name" => "AP In-line Chlorinator",
        "price" => "$0"
        ),
    
    array(
        "name" => "IC20 Intellichlor Salt Chlorination System",
        "price" => "$1,700"
        ),
    
);
 
$lighting = array(
 
    array(
        "name" => "300 Watt Pool Light",
        "price" => "$0"
        ),
    
    array(
        "name" => "Spectrum LED Color Changing Light (Pool only)",
        "price" => "$750"
        ),
    
    array(
        "name" => "Spectrum LED Color Changing Light (Spa only)",
        "price" => "$570"
        ),
    
    array(
        "name" => "Spectrum LED Color Changing Light (Pool and spa)",
        "price" => "$1.320"
        ),
    
);
 
$heater = array(
 
    array(
        "name" => "No heater",
        "price" => "$0"
        ),
    
    array(
        "name" => "250K BTU Electronic Ignition Gas Heater, Hook up by Others",
        "price" => "$2,700"
        ),
    
    array(
        "name" => "400K BTU Electronic Ignition Gas Heater, Hook up by Others",
        "price" => "$3,380"
        ),
    
    array(
        "name" => "4 Ton Electric Heat Pump + Elec.",
        "price" => "$6,230"
        ),
    
    array(
        "name" => "5 Ton Electric Heat Pump + Elec.",
        "price" => "$7,540"
        ),
    
    array(
        "name" => "Solar Heat, 6 Panels, 13\"x26\"",
        "price" => "$5,100"
        ),
    
    array(
        "name" => "Solar Heat, 8 Panels, 14\"x28\"",
        "price" => "$6,000"
        ),
    
);
 
$automation_system = array(
 
    array(
        "name" => "No automation system",
        "price" => "$0"
        ),
    
    array(
        "name" => "Inteli Touch P/S4 Automation System w/ Wired Remote",
        "price" => "$2,700"
        ),
    
);
 
$pool_cleaning_system = array(
 
    array(
        "name" => "Pool cleaning system",
        "price" => "$0"
        ),
    
    array(
        "name" => "Hayward Navigator Automatic Pool Cleaner",
        "price" => "$680"
        ),
    
    array(
        "name" => "Sta-Rite Great White Automatic Pool Cleaner",
        "price" => "$680"
        ),
    
    array(
        "name" => "In-floor Cleaning System",
        "price" => "$3,150"
        ),
    
);
 
$deck_size = array(
 
    array(
        "name" => "Deck Size A",
        "price" => "$0"
        ),
    
    array(
        "name" => "Deck Size B",
        "price" => "$0"
        ),
    
);
 
$deck_style = array(
 
    array(
        "name" => "Acrylic Texture Deck",
        "price" => "$0"
        ),
    
    array(
        "name" => "Pavers Upgrade Deck (Most styles and colors)",
        "price" => "$600"
        ),
    
);
 
$pool_edge_style = array(
 
    array(
        "name" => "Brick Coping",
        "price" => "$0"
        ),
    
);
 
$deco_drain = array(
 
    array(
        "name" => "Standard 2\" Deck Drain",
        "price" => "$0"
        ),
    
);
 
$raised_deck = array(
 
    array(
        "name" => "No raised deck",
        "price" => "$0"
        ),
    
    array(
        "name" => "6\" Raised Rear Deck",
        "price" => "$1,280"
        ),
    
    array(
        "name" => "12\" Raised Rear Deck",
        "price" => "$2,060"
        ),
    
);
 
$raised_planter = array(
 
    array(
        "name" => "No raised planter",
        "price" => "$0"
        ),
    
    array(
        "name" => "6\" Raised Rear Planter",
        "price" => "$1,740"
        ),
    
    array(
        "name" => "12\" Raised Rear Planter",
        "price" => "$2,790"
        ),
    
);
 
$water_features = array(
 
    array(
        "name" => "No water features",
        "price" => "$0"
        ),
    
    array(
        "name" => "Pair of Lion Heads (Only w/ raised deck option)",
        "price" => "$380"
        ),
    
    array(
        "name" => "Pair of Fan Sprays (Only w/ raised deck option)",
        "price" => "$380"
        ),
    
    array(
        "name" => "2' Waterfall (Only w/ raised deck option)",
        "price" => "$2,790"
        ),
    
);
 
$screen_cage = array(
 
    array(
        "name" => "Bronze Screen Cage",
        "price" => "$0"
        ),
    
    array(
        "name" => "White Screen Cage",
        "price" => "$0"
        ),
    
);
 
$child_safety = array(
 
    array(
        "name" => "Door Alarms",
        "price" => "$0"
        ),
    
    array(
        "name" => "Baby Barrier Fence",
        "price" => "$650"
        ),
    
);
 
?>
 
<div class="container">
 
<form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>#results">
 
<span class="form-divider">
 
<h1>Contact information</h1>
 
<h2>Name</h2>
 
  <input type="text" name="name" size="50"/>
 
<h2>Email</h2>
 
  <input type="text" name="email" size="50"/>
 
<h2>Phone</h2>
 
  <input type="text" name="phone" size="50"/>
 
<h2>Street address</h2>
 
  <input type="text" name="address" size="50"/>
 
<h2>City</h2>
 
  <input type="text" name="city" size="50"/>
 
<h2>State</h2>
 
<select name="state" size="1">
    <option value="AK">AK</option>
    <option value="AL">AL</option>
    <option value="AR">AR</option>
    <option value="AZ">AZ</option>
    <option value="CA">CA</option>
    <option value="CO">CO</option>
    <option value="CT">CT</option>
    <option value="DC">DC</option>
    <option value="DE">DE</option>
    <option value="FL" selected>FL</option>
    <option value="GA">GA</option>
    <option value="HI">HI</option>
    <option value="IA">IA</option>
    <option value="ID">ID</option>
    <option value="IL">IL</option>
    <option value="IN">IN</option>
    <option value="KS">KS</option>
    <option value="KY">KY</option>
    <option value="LA">LA</option>
    <option value="MA">MA</option>
    <option value="MD">MD</option>
    <option value="ME">ME</option>
    <option value="MI">MI</option>
    <option value="MN">MN</option>
    <option value="MO">MO</option>
    <option value="MS">MS</option>
    <option value="MT">MT</option>
    <option value="NC">NC</option>
    <option value="ND">ND</option>
    <option value="NE">NE</option>
    <option value="NH">NH</option>
    <option value="NJ">NJ</option>
    <option value="NM">NM</option>
    <option value="NV">NV</option>
    <option value="NY">NY</option>
    <option value="OH">OH</option>
    <option value="OK">OK</option>
    <option value="OR">OR</option>
    <option value="PA">PA</option>
    <option value="RI">RI</option>
    <option value="SC">SC</option>
    <option value="SD">SD</option>
    <option value="TN">TN</option>
    <option value="TX">TX</option>
    <option value="UT">UT</option>
    <option value="VA">VA</option>
    <option value="VT">VT</option>
    <option value="WA">WA</option>
    <option value="WI">WI</option>
    <option value="WV">WV</option>
    <option value="WY">WY</option>
</select>
 
<h2>Zip</h2>
 
  <input type="text" name="zip" size="10"/>
 
</span>
 
<span class="form-divider">
 
<h1>Pool options</h1>
 
<h2>Pool model</h2>
 
   <select name="pool_name" class="dropdown">
   <?php
    foreach($pool_name as $value) 
    { 
        echo "<option value=\"".$value["name"]."\">".$value["name"]."</option>"; 
    } 
    ?>
  </select>
 
<h2>Size</h2>
 
   <select name="pool_size" class="dropdown">
   <?php
    foreach($pool_size as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Depth</h2>
 
   <select name="pool_add_depth" class="dropdown">
   <?php
    foreach($pool_add_depth as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Sun shelf</h2>
 
   <select name="sun_shelf" class="dropdown">
   <?php
    foreach($sun_shelf as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Custom spa</h2>
 
   <select name="custom_spa" class="dropdown">
   <?php
    foreach($custom_spa as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Blower</h2>
 
   <select name="blower_option" class="dropdown">
   <?php
    foreach($blower_option as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Finish</h2>
 
   <select name="pool_finish" class="dropdown">
   <?php
    foreach($pool_finish as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Tile</h2>
 
   <select name="pool_tile" class="dropdown">
   <?php
    foreach($pool_tile as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Pump</h2>
 
   <select name="pool_pump" class="dropdown">
   <?php
    foreach($pool_pump as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Filter</h2>
 
   <select name="pool_filter" class="dropdown">
   <?php
    foreach($pool_filter as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Sanatizer</h2>
 
   <select name="sanatizer" class="dropdown">
   <?php
    foreach($sanatizer as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Lighting</h2>
 
   <select name="lighting" class="dropdown">
   <?php
    foreach($lighting as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Heater</h2>
 
   <select name="heater" class="dropdown">
   <?php
    foreach($heater as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Automation system</h2>
 
   <select name="automation_system" class="dropdown">
   <?php
    foreach($automation_system as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Pool cleaning system</h2>
 
   <select name="pool_cleaning_system" class="dropdown">
   <?php
    foreach($pool_cleaning_system as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Deck size</h2>
 
   <select name="deck_size" class="dropdown">
   <?php
    foreach($deck_size as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Deck style</h2>
 
   <select name="deck_style" class="dropdown">
   <?php
    foreach($deck_style as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Pool edge style</h2>
 
   <select name="pool_edge_style" class="dropdown">
   <?php
    foreach($pool_edge_style as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Deco drain</h2>
 
   <select name="deco_drain" class="dropdown">
   <?php
    foreach($deco_drain as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Raised deck</h2>
 
   <select name="raised_deck" class="dropdown">
   <?php
    foreach($raised_deck as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Raised planter</h2>
 
   <select name="raised_planter" class="dropdown">
   <?php
    foreach($raised_planter as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Water features</h2>
 
   <select name="water_features" class="dropdown">
   <?php
    foreach($water_features as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Screen cage</h2>
 
   <select name="screen_cage" class="dropdown">
   <?php
    foreach($screen_cage as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<h2>Child safety</h2>
 
   <select name="child_safety" class="dropdown">
   <?php
    foreach($child_safety as $value) 
    { 
        echo "<option value=\"".$value["name"]."&nbsp;(".($value["price"]).")"."\">".$value["name"]."&nbsp;&nbsp;(".($value["price"]).")"."</option>"; 
    } 
    ?>
  </select>
 
<br />
 
<input type='submit' value='Submit Quote'>
 
</span>
 
</form>
 
</div>
 
</body>
</html>

Re: form processing errors

Posted: Thu Nov 20, 2008 4:37 pm
by infolock
Here's the thing. Someone else might want to go through 900+ lines of code, but I'm not exactly in the mood tonight, sorry...


So, instead I'm just going to give you a really quick and easy way to figure this out on your own.

First, create a new form in a new file, and only put one field in there. Call it like "first_name" (ie: <input type="text" name="first_name" />)

Then, submit the new form to the same file. Make it do what you want to, and then apply that same logic to your big 900 line file. Sounds simple, but it will work ;)

if you have issues with that, post your code of the new form and we'll go from there.