Hello, I'm new to php but not programming in general so please be gentle. I've spent the last few days trying to make this whole thing work and I'm stumped on this one. I have a web form that posts to order.php so I can automatically fill in some info and keep it simple for the end user. Unfortunately without the details in the function being set, I'm up a creek. Any help would be greatly appreciated. TIA! <?php import_request_variables('p', 'p_'); // Const $cost1 = "25.00"; // part 1 $cost2 = "95.00"; // part 2 $cost3 = "115.00"; // part 1 & 2 // Functions function setkit(){ if ($p_kit == "brake") {$item="Brake Kit"; $ship="5.00"; $cost=$cost2;} elseif ($p_kit == "clutch") {$item="Clutch Kit"; $ship="5.00"; $cost=$cost1;} elseif ($p_kit == "combo") {$item="Brake & Clutch Combo"; $ship="5.00"; $cost=$cost3;} elseif ($p_kit == "cam") {$item="Cam Gear"; $ship="5.00"; $cost=$cost2;} elseif ($p_kit == "everything") {$item="Everything Package"; $ship="10.00"; $cost=$cost2 + $cost3;} } // function writelog(){} - TBD setkit(); ?> Code (markup): p_kit is imported from the first form as a selection box with 5 options. All my other p_ imports are working fine, even if I echo p_kit it returns with the correct value, I just can't get setkit() called, or i've done it wrong.?
I changed everything over to Switch/Case and it's working fine.. Now to work on tryin to make the data into a text log.. I'm sure I'll post back on that one... p.s. here's what i made it in to.. // Vars $kit = $p_kit; // Setup Kit Costs switch($kit){ case "brake": $item="Brake Kit"; $ship="5.00"; $cost=$cost1; break; case "clutch": $item="Clutch Kit"; $ship="5.00"; $cost=$cost1; break; case "combo": $item="Brake & Clutch Combo"; $ship="5.00"; $cost=$cost3; break; case "cam": $item="Adjustable Cam Gear"; $ship="5.00"; $cost=$cost2; break; case "everything": $item="The Everything Package"; $ship="10.00"; $cost=$cost2 + $cost3; break; default: $item=""; $ship=""; $cost=""; break; } Code (markup): Thanks!