Location: PHPKode > scripts > Free PHP Shopping Cart > FPHPSC/ShoppingCart.php
<?
//////////////////////////////////////////////////////////////////////
// The freebert.com Free PHP Shopping Cart:
// Version 0.80 - July 14th, 2009
// License / Terms of Use:
// Free to use, edit & customize, so long as the freebert.com logo, 
// the 'Powered By The Free PHP Shopping Cart' text & links 
// remain displayed on the bottom of every visable shopping cart page. 
// Redistribution in whole or in part of any page or function within 
// the freebert.com Free PHP Shopping Cart is strictly forbidden
// without the express written consent from freebert.com.
// Copyright (c) 2007 - 2009  by Colin Burke - freebert.com
// Contact: hide@address.com
// Support: http://www.freebert.com/Wiki/index.php/FPHPSC
// NOTE: If you want a cart script package with more features like
// customer accounts, database integration, administration section,
// online customer orderstatus section and more, OR
// if you simply want to legally remove the logo & links and
// continue to use the freebert.com Free PHP Shopping Cart
// you may do so by buying a domain license for the freebert.com
// Deluxe PHP SQL Shopping Cart Script. For details go to:
// http://www.freebert.com/Products/DeluxePHPSQLShoppingCart/ 
//////////////////////////////////////////////////////////////////////

session_start();
// Load Settings
require_once('Local_Settings.php');

// Load Functions
require_once('inc/functions/Cart_Templates.php');
require_once('inc/functions/Cart_Functions.php');

// Check For Required Actions
if (is_numeric($_POST['cmd']))
{
  $cmd_In = $_POST['cmd'];
} else
{
  // Error, No ID, Send Away
  $cmd_In = '';
}

// Batch Add Items
if ($cmd_In==5)
{
  AddBatch($_POST,$Session_Prefix);
}

// Update Cart Content
if ($cmd_In==4)
{
  UpdateCart($_POST,$Session_Prefix);
}

// 
if ($cmd_In==1)
{
  // Add Item To Cart
  // Parse Optional Inputs Into Title & Serial
  $title_In = cleanvalue($_POST['Title']);
  $serialnum_In = cleanvalue($_POST['SerialNum']);
  $ImageURL_In = cleanvalue($_POST['ImageURL']);
  
  if (is_numeric($_POST['Price']))
  {
    $price_In = $_POST['Price'];
  } else
  {
    // Error, No ID, Send Away
    $price_In = '';
  }
  
  if (is_numeric($_POST['Shipping1']))
  {
    $shipping1_In = $_POST['Shipping1'];
  } else
  {
    // Error, No ID, Send Away
    $shipping1_In = '';
  }
  
  if (is_numeric($_POST['Shipping2']))
  {
    $shipping2_In = $_POST['Shipping2'];
  } else
  {
    // Error, No ID, Send Away
    $shipping2_In = '';
  }
  
  AddItemToCart($title_In,$serialnum_In,$price_In,$shipping1_In,$shipping2_In,$Session_Prefix,1,$ImageURL_In);
}

// Do HTML Header
Open_Cart_HTML($Site_Script_Root_Directory,$CSS_Filename,$Site_Title.' - Shopping Cart',"
<META NAME='keywords' CONTENT='".$Site_Title." Shopping Cart'>
");

include('inc/skin/Overall_Header.php');
?>
<br>
<table width="100%" border="0" align="center"> 
  <tr> 
    <td valign="top">  <div align="center">
<? echo Cart_Menu(1); ?><br />
      <div class="CartPageInfoBox CartPageInfoBG" style="width:500">
      <span class='Bold'>Please Verify Your Order is Correct Before Continuing With Checkout:</span></div>
      <br />
      <table border="0">
        <tr>
          <td><div align="center" class="CartContentsBox CartContentsBG"><? echo DisplayEditableCart($Session_Prefix,$Currency_Symbol,$Currency_Code);?></div></td>
        </tr>
      </table><br />
    </div></td> 
  </tr> 
</table>
<br><br>
<?
include('inc/skin/Overall_Footer.php');
// Do HTML footer
Close_Cart_HTML($Site_Domain,$Site_Script_Root_Directory);

//////////////////////////////////////////////////////////////////////
// The freebert.com Free PHP Shopping Cart:
// Version 0.80 - July 14th, 2009
// License / Terms of Use:
// Free to use, edit & customize, so long as the freebert.com logo, 
// the 'Powered By The Free PHP Shopping Cart' text & links 
// remain displayed on the bottom of every visable shopping cart page. 
// Redistribution in whole or in part of any page or function within 
// the freebert.com Free PHP Shopping Cart is strictly forbidden
// without the express written consent from freebert.com.
// Copyright (c) 2007 - 2009  by Colin Burke - freebert.com
// Contact: hide@address.com
// Support: http://www.freebert.com/Wiki/index.php/FPHPSC
// NOTE: If you want a cart script package with more features like
// customer accounts, database integration, administration section,
// online customer orderstatus section and more, OR
// if you simply want to legally remove the logo & links and
// continue to use the freebert.com Free PHP Shopping Cart
// you may do so by buying a domain license for the freebert.com
// Deluxe PHP SQL Shopping Cart Script. For details go to:
// http://www.freebert.com/Products/DeluxePHPSQLShoppingCart/ 
//////////////////////////////////////////////////////////////////////
?>
Return current item: Free PHP Shopping Cart