|
|
|
$DEBUG=0; $LOCAL=0; $action_page="place_an_order.php"; if ($DEBUG) { print "B1 = ".$B1." \n"; foreach ($HTTP_POST_VARS as $key => $value) { print "vars[".$key."] = '".$value."' \n"; } } if ($B1=="Send My Order") { if (($retval=validate( $HTTP_POST_VARS)) == "") { print " "; print " \n"; print " "; print "Data Missing - All fields must be entered "; print "The following fields were missing $retval "; print ""; show_form($HTTP_POST_VARS); } } else if ($B1=="Send My Order") { show_form($HTTP_POST_VARS); } else { $HTTP_POST_VARS['Company'] = ""; $HTTP_POST_VARS['email_address'] = ""; $HTTP_POST_VARS['Customer_Rep'] = ""; $HTTP_POST_VARS['telephone'] = ""; $HTTP_POST_VARS['required_items'] = ""; $HTTP_POST_VARS['Drawings'] = ""; $HTTP_POST_VARS['PO_Number'] = ""; show_form($HTTP_POST_VARS); } function validate ($post_vars) { $retval = ""; $sep =""; if ( $post_vars['Company'] == "" ) { $retval .= "Company"; $sep = "," ; } if ($post_vars['email_address'] == "" ) { $retval .= $sep."Email Address"; $sep = "," ; } if ($post_vars['Customer_Rep'] == "" ) { $retval .= $sep."Your Name"; $sep = "," ; } if ($post_vars['telephone'] == "" ) { $retval .= $sep."Telephone"; $sep = "," ; } if ($post_vars['required_items'] == "" ) { $retval .= $sep."Required Items"; $sep = "," ; } if ($post_vars['Drawings'] == "" ) { $retval .= $sep."Drawings"; $sep = "," ; } if ($post_vars['PO_Number'] == "" ) { $retval .= $sep."Purchase Order"; $sep = "," ; } return $retval; } function show_form ($post_vars) { print " "; } ?> |
|
|