Commit e9b0cd9a authored by Maneesha Fernando's avatar Maneesha Fernando

update admin-update

parent 238279e1
<?php <?php
// Check if session is not already started, then start it.
if (session_id() == '' || !isset($_SESSION)) { if (session_id() == '' || !isset($_SESSION)) {
session_start(); session_start();
} }
// Check if $_SESSION["type"] is set and not empty
if (!isset($_SESSION["type"]) || empty($_SESSION["type"])) {
header("location:index.php");
exit(); // Add an exit to prevent further execution
}
if ($_SESSION["type"] != "admin") { if ($_SESSION["type"] != "admin") {
header("location:index.php"); header("location:index.php");
exit(); // Add an exit to prevent further execution
} }
include 'config.php'; include 'config.php';
$_SESSION["products_id"] = array(); $_SESSION["products_id"] = array();
$_SESSION["products_id"] = $_REQUEST['quantity']; if (isset($_REQUEST['quantity'])) {
$_SESSION["products_id"] = $_REQUEST['quantity'];
}
$result = $mysqli->query("SELECT * FROM products ORDER BY id asc"); $result = $mysqli->query("SELECT * FROM products ORDER BY id asc");
$i = 0; $i = 0;
...@@ -41,4 +51,5 @@ if ($result) { ...@@ -41,4 +51,5 @@ if ($result) {
} }
header("location:success.php"); header("location:success.php");
exit(); // Add an exit to prevent further execution
?> ?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment