Any one? Please, I really need this and I'm stuck. I can't really go on with the site because most of it would be based on this... on this thing and by not having it would lead me to a dead end... well it did already

Is there really no tutorial out there and nobody who knows anything about it?
[EDIT:] I tried the following test to see how setting an object to a session would work.
<?php
$test = new test();
$test->items = array('boots','shoes','computer','LCD Monitors','Disks');
$test->names = array('Billy Bob','Joe Daniels McMuffin','Billy Bob Joes');
$this->test = 'forgetful';
$test->save();
$test->get_that();
class test {
var $items = array();
var $names = array();
var $testing = null;
var $returns = false;
var $test = null;
var $test2 = 1;
function test($totals = false)
{
if(isset($names[0]) && isset($names[1]))
{
$res = explode(',', $names);
if($totals)
{
$res .= count($names);
}
}
$this->test = $res;
}
function what_is_this()
{
$i = 0;
foreach($this->items as $key => $value)
{
$this->testing2[$key][$i] = $value;
++$i;
}
$this->set();
}
function set_this()
{
$this->test2 = $this->test;
$this->save();
}
function get_that()
{
if($this->returns)
{
return "<pre>\n" . $_SESSION['test'] . "</pre>\n";
}
else
{
echo "<pre>\n";
print_r($_SESSION['test']);
echo "</pre>\n";
}
}
function return_this()
{
$this->what_is_this();
return 'this';
}
function save()
{
$this->testing = $this->return_this();
}
function set()
{
$_SESSION['test'] = (array) $this;
}
}
?>
- <?php
- $test = new test();
- $test->items = array('boots','shoes','computer','LCD Monitors','Disks');
- $test->names = array('Billy Bob','Joe Daniels McMuffin','Billy Bob Joes');
- $this->test = 'forgetful';
- $test->save();
- $test->get_that();
-
- class test {
-
- var $items = array();
-
- var $names = array();
-
- var $testing = null;
-
- var $returns = false;
-
- var $test = null;
-
- var $test2 = 1;
-
- function test($totals = false)
- {
- if(isset($names[0]) && isset($names[1]))
- {
- $res = explode(',', $names);
- if($totals)
- {
- $res .= count($names);
- }
- }
- $this->test = $res;
-
- }
-
- function what_is_this()
- {
- $i = 0;
- foreach($this->items as $key => $value)
- {
- $this->testing2[$key][$i] = $value;
- ++$i;
- }
- $this->set();
- }
-
- function set_this()
- {
- $this->test2 = $this->test;
- $this->save();
- }
-
- function get_that()
- {
- if($this->returns)
- {
- return "<pre>\n" . $_SESSION['test'] . "</pre>\n";
- }
- else
- {
- echo "<pre>\n";
- print_r($_SESSION['test']);
- echo "</pre>\n";
- }
- }
-
- function return_this()
- {
- $this->what_is_this();
- return 'this';
- }
-
- function save()
- {
- $this->testing = $this->return_this();
- }
-
- function set()
- {
- $_SESSION['test'] = (array) $this;
- }
- }
- ?>
It gave me the following output:
Array
(
[items] => Array
(
[0] => boots
[1] => shoes
[2] => computer
[3] => LCD Monitors
[4] => Disks
)
[names] => Array
(
[0] => Billy Bob
[1] => Joe Daniels McMuffin
[2] => Billy Bob Joes
)
[testing] =>
[returns] =>
[test] => forgetful
[test2] => 1
[testing2] => Array
(
[0] => Array
(
[0] => boots
)
[1] => Array
(
[1] => shoes
)
[2] => Array
(
[2] => computer
)
[3] => Array
(
[3] => LCD Monitors
)
[4] => Array
(
[4] => Disks
)
)
)
- Array
- (
- [items] => Array
- (
- [0] => boots
- [1] => shoes
- [2] => computer
- [3] => LCD Monitors
- [4] => Disks
- )
-
- [names] => Array
- (
- [0] => Billy Bob
- [1] => Joe Daniels McMuffin
- [2] => Billy Bob Joes
- )
-
- [testing] =>
- [returns] =>
- [test] => forgetful
- [test2] => 1
- [testing2] => Array
- (
- [0] => Array
- (
- [0] => boots
- )
-
- [1] => Array
- (
- [1] => shoes
- )
-
- [2] => Array
- (
- [2] => computer
- )
-
- [3] => Array
- (
- [3] => LCD Monitors
- )
-
- [4] => Array
- (
- [4] => Disks
- )
-
- )
-
- )
-
All that stuff in the class is for testing purposes only that I did in about 2 minutes... I didn't really have any set function in mind other then to test.
How would I go about creating a shopping cart like this? It now seems kind of EASIER than I thought at first, but I don't know how to set up the array and how to get everything to work in peace with each other...
Also, I'm still in the dark on how I would go about doing the transaction thing. I looked through php.net and found out that there are certain functions available just for that but I don't know if they are safe, how to use them, what they are for (more specifically) and how to go about implementing that to the shopping cart if and when I'm done.
"Bring forth therefore fruits meet for repentance:" Matthew 3:8