purchase.php

来自「php源码 php源码参考」· PHP 代码 · 共 45 行

PHP
45
字号
<?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();?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?