Location: PHPKode > scripts > Couffin: A simple PHP shopping basket > couffin-a-simple-php-shopping-basket/failure.php
<?php
/*                                                                              
    Couffin - A simple PHP shopping basket.                                    
                                                                              
    Copyright 2005 by Georges Auberger                                            
	http://www.auberger.com/couffin
                                                                                                                                                           
    Couffin is free software; you can redistribute it and/or modify               
    it under the terms of the GNU General Public License as published by      
    the Free Software Foundation; either version 2 of the License, or         
    (at your option) any later version.                                       
                                                                              
    Couffin is distributed in the hope that it will be useful,                    
    but WITHOUT ANY WARRANTY; without even the implied warranty of            
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the              
    GNU General Public License for more details.                              
                                                                                                                                                            
    You should have received a copy of the GNU General Public License         
    along with this program; if not, you can find it here:                    
    http://www.gnu.org/copyleft/gpl.html                                      
*/

include_once "config/settings.php";
include_once "class/product.inc";
include_once "class/cart.inc";
include_once "class/customer.inc";
include_once "class/invoice.inc";
include_once "class/states.inc";
include_once "class/orderProcessor.inc";
include_once "config/products.php";

session_start();

// If no session exists, we have a problem
if (!session_is_registered('invoice')) {
	header("Location: " . $settings->siteUrl);
	exit;
} 	

$title = "Error";
include "header.php"; 

$invoice = $_SESSION['invoice'];

?>
<div id="navmenu">
	<ul>
		<li class="first">
			<a href="index.php">View Catalog</a>
		</li>
		<li class="last">
			<a href="invoice.php">Check Out</a>
		</li>
	</ul>
</div>
<?
if ($invoice->validate()) {		
	// Insure a unique order number for each submission
	$invoice->newOrderNumber();
	$_SESSION['invoice'] = $invoice;
?>
<p class="warning">
	We are sorry, we are unable to process your credit card or it has been declined.<br />
	Please try a to <a href='invoice.php'>check out</a> with a different credit card.
</p>

<?
} else {
?>
<p class="error">
	You don't have a valid invoice!
</p>

<?
}	
include "footer.php"; 
?>
Return current item: Couffin: A simple PHP shopping basket