i have simple shopping cart and i m working in checkout script but when the user fill out the form of the detail of him and than press the purchase button it should be taken to the purchase script but it gives this massege;
could not store data,please try again.
i want to find out why i have this massege every time when i fill the checkout form
and this is my code:
chechout script;
<?php
//include our function set
include ('book_sc_fns.php');
do_html_header('Checkout');
if($SESSION['cart']&&array_count_values($SESSION['cart']))
{
display_cart($_SESSION['cart'], false, 0);
display_checkout_form();
}
else
echo '<p>There are no items in your cart</p>';
display_button('show_cart.php', 'continue-shopping', 'Continue Shopping');
do_html_footer();
?>
<?php
include ('book_sc_fns.php');
// The shopping cart needs sessions, so start one
session_start();
do_html_header("Checkout");
// create short variable names
$name = $POST['name'];
$address = $POST['address'];
$city = $POST['city'];
$zip = $POST['zip'];
$country = $_POST['country'];
// if filled out
if($SESSION['cart']&&$name&&$address&&$city&&$zip&&$country)
{
// able to insert into database
if( insert_order($POST)!=false )
{
//display cart, not allowing changes and without pictures
display_cart($_SESSION['cart'], false, 0);
display_shipping(calculate_shipping_cost());
//get credit card details
display_card_form($name);
display_button('show_cart.php', 'continue-shopping', 'Continue Shopping');
}
else
{
echo 'Could not store data, please try again.';
display_button('checkout.php', 'back', 'Back');
}
}
else
{
echo 'You did not fill in all the fields, please try again.<hr />';
display_button('checkout.php', 'back', 'Back');
}
do_html_footer();
?>