I have three functions written which work and I want to only display one
of them depending on user input.
What is the correct way to code this?
I can display all three functions but not one.
 
this is my code:
 
<?
 
  include ('products_sc_fns.php');
  // The shopping cart needs sessions, so start one
  session_start();
 
  do_html_header("Checkout");
  // if filled out
  if($cart&&$name&&$address&&$city&&$zip&&$country)
  
  {
    // able to insert into database
    if( insert_order($HTTP_POST_VARS)!=false )
    {
      //display cart, not allowing changes and without pictures 
      display_cart($cart, false, 0);
   calculate_weight($cart);
   //de-bug
   //echo "test & $country & $express";
   
   display_shipping(calculate_shipping_cost($weight));
   display_shipping(calculate_nonfinland_cost($country));
   display_shipping(calculate_express_cost($express));
   //display_shipping(calculate_temp_shipping_cost($weight)); 
      //get credit card details
   calculate_final_cost($total_price, $shipping);
   get_order_id();
   display_card_form($name, $final_cost);
    echo "<table width='760' cellpadding='0'
background='images/shopbg.gif'><tr><td width='200'>&nbsp;</td>";
       echo "<td align='right'>";
      display_button("show_cart.php", "continue-shopping", "Continue
Shopping");  
    echo "</td></tr></table>";
    }
    else
    {
  // error info and footer goes here.
 
 
I want to display shipping if the user is from finland and paying an
express cost 
display_shipping(calculate_express_cost($express));
 
from finland but paying by weight of shipping
display_shipping(calculate_shipping_cost($weight));

or from outside of finland
display_shipping(calculate_nonfinland_cost($country));
 
How do I write the If statement to say if country=finland&express=yes
display function 1
then if country = finland but express="" display function 2 or if
country isn't finland do 3?
 
Tried all morning and repeatedly failed!
 

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com <http://www.violasystems.com/> 
[EMAIL PROTECTED]
Mobile +358 50 343 5159



 

Reply via email to