Jump to content

Sessions in cart


loxy1914

Recommended Posts

create an array then store it into the session.

 

example

 

<?php
session_start();

$carnew = array();

$model = $_GET['model'];
$color = $_GET['color'];
$price = $_GET['price'];
$firm = $_GET['firm'];

$carnew['0'] = $model;
$carnew['1'] = $color;
$carnew['2'] = $price;
$carnew['3'] = $firm;

$_SESSION['cars'] = array();

$_SESSION['cars']['0'] = $carnew;

print_r($_SESSION['cars']);

?>

Link to comment
https://forums.phpfreaks.com/topic/251615-sessions-in-cart/#findComment-1290416
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.