}
// Validate credit card date
if (isset($details["cardExpiry"])) {
    if (date("Y-m") > $details["cardExpiry"]) {
        $error["cardExpiry"] = "Card has expired, please enter a non-expired date.";
        $detailsChecked = false;
    }
}
// Don't error for first visit
if ($_SESSION["checkoutVisit"] === false) {
    unset($error);
    $_SESSION["checkoutVisit"] = true;
}
// Save customer details
if ($detailsChecked) {
    AppendToJSON($details, "customer.details");
    if (isset($_SESSION["cart"])) {
        $_SESSION["oldCart"] = $_SESSION["cart"];
    }
    unset($_SESSION["cart"]);
}
?>

<!DOCTYPE html>
<html>
	<head>
		<title>Buy Games - Checkout</title>
		<?php 
require_once "css.php";
?>
	</head>
Exemple #2
0
if ($result->num_rows > 0) {
    $product = $result->fetch_assoc();
}
// Display any reviews
$filename = "reviews/reviews_" . $productIndex . ".reviews";
if (isset($_POST["email"])) {
    $email = $_POST["email"];
}
if (isset($_POST["commentBody"])) {
    $comment = $_POST["commentBody"];
    $comment = htmlspecialchars(strip_tags(trim($comment)));
}
// Save a new review
if (isset($email) && isset($comment)) {
    $write = array('email' => $email, 'comment' => $comment);
    AppendToJSON($write, $filename);
}
?>

<!DOCTYPE html>
<html>
	<head>
		<title>Buy Games - <?php 
echo $product !== null ? $product["name"] : "404";
?>
 </title>
		<?php 
require_once "css.php";
?>
	</head>
	<body>