Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,208,353 members, 8,002,332 topics. Date: Thursday, 14 November 2024 at 09:14 AM |
Nairaland Forum / Adeyeye546's Profile / Adeyeye546's Posts
(1) (of 1 pages)
Programming / Trying To Remove Item Fro A Shopping Cart. by adeyeye546: 10:59am On Oct 09, 2014 |
<?php if (isset($_POST['index_to_remove']) && $_POST['index_to_remove'] != "" { // Access the array and run code to remove that array index // Reomve functionality $key_to_remove = $_POST['index_to_remove'];// hold array index to that variable and pass it to the local variable if (count($_SESSION["cart_array"]) <= 1) { // if item greater than one unset($_SESSION["cart_array"]); // header("location: cart.php" } else { unset($_SESSION["cart_array"]["$key_to_remove"]);//correspond to the cart_item //sort($_SESSION["cart_array"]) sort($_SESSION["cart_array"]); // sorting of all the multi- dimensional array }; } |
(1) (of 1 pages)
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 4 |