0% found this document useful (0 votes)
5 views1 page

Success PHP

The document is a PHP script that confirms a user's purchase by updating the status of purchased items in the database. If the user is not logged in, they are redirected to the index page. Upon successful purchase, a confirmation message is displayed along with a link to continue shopping.

Uploaded by

nishita6978
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Success PHP

The document is a PHP script that confirms a user's purchase by updating the status of purchased items in the database. If the user is not logged in, they are redirected to the index page. Upon successful purchase, a confirmation message is displayed along with a link to continue shopping.

Uploaded by

nishita6978
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

success.

php
<?php

require("common.php");
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
$user_id = $_SESSION['user_id'];
$item_ids_string = $_GET['itemsid'];

//We will change the status of the items purchased by the user to 'Confirmed'
$query = "UPDATE user_item SET status=2 WHERE user_id=" . $user_id . " AND item_id
IN (" . $item_ids_string . ") and status= 1 ";
mysqli_query($con, $query) or die($mysqli_error($con));
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width = device-width, initial-scale = 1">
<title>Success | Life Style Store</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<?php include 'header.php'; ?>

<div class="container-fluid" id="content">


<div class="col-md-12">
<div class="col-lg-4 col-md-6 ">
<img src="img/thanks.png" style="float: left;">
</div>
<div class="jumbotron">
<h3 align="center">YAY!! Your order is confirmed. Thank you
for shopping with us.</h3><hr>
<p align="center">Click <a href="products.php">here</a> to
purchase any other item.</p>
</div>
</div>
</div>
<?php include("includes/footer.php");
?>
</body>
</html>

You might also like