-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd_cart.php
More file actions
27 lines (19 loc) · 713 Bytes
/
add_cart.php
File metadata and controls
27 lines (19 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
session_start();
$id = $_GET['id'];
$name = $_GET['p_name'];
$price = $_GET['p_price'];
$qty = $_GET['qty'];
$p_img = $_GET['p_img'];
$_SESSION['cart'][$id] = array("id"=>$id,"qty" =>$qty,"p_name"=>$name,"p_price"=>$price,"p_img"=>$p_img);
echo " <script>window.location.assign('cart.php');</script> ";
header("Location:cart.php");
// $products = array($name,$price,$quantity);
// $_SESSION[$cart] = $products;
// header('location:index.php');
// $pid = $_GET['pid'];
// $qty = $_GET['qty'];
// $_SESSION['cart'] [$pid] = array("id"=>$pid,"qty"=>$qty);
// echo " <script>window.location.assign('add_cart.php');</script> ";
// header("Location:add_Cart.php");
?>