Send array from php to php

HI every one
I' try to send array from web page to php file
but no data are show
I'm using session to store data
and this is my code
//////////////////////////////////////////////////////////// ////////////
$data = $cart_items;
session_register('data');
foreach ($cart_items as $cart_item) {
echo "<tr>";
echo " <td><span class='style2'>".$cart_item->name."</span></td>";
echo " <td><span class='style2'>".$cart_item->description."</
span></td>";
echo " <td><span class='style2'>".$cart_item->price." S.R.</span></
td>";
echo " <td><span class='style2'>".$cart_item->quantity."</span></
td>";
echo " <td><span class='style2'>".$cart_item->price * $cart_item-
>quantity."</span></td>";
echo " <td><span class='style4'><a href='order.php?action=del&id=".
$cart_item->object_id."'>[del]</a></span></td>";
echo "</tr>";
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\
\

and this is my php code to get the data
////////////////////////////////////////////////////////
<?php
foreach ($data as $item)
{
echo "<tr>";
print " <td><span class='style2'>".$item->name."</span></td>";
echo " <td><span class='style2'>".$item->description."</span></td>";
echo " <td><span class='style2'>".$item->price." $</span></td>";
echo " <td><span class='style2'>".$item->quantity."</span></td>";
echo " <td><span class='style2'>".$item->price * $cart_item-
>quantity."</span></td>";
echo "</tr>";
}
?>

\\\\\\\\\\\

whene this code is runing
it create table white correct number of row but no data is show
can any one help me white this
I will be thankful
Salim
sahm [ Sa, 19 Januar 2008 10:58 ] [ ID #1912086 ]

Re: Send array from php to php

..oO(sahm)

>I' try to send array from web page to php file
>but no data are show
>I'm using session to store data
>and this is my code
>/////////////////////////////////////////////////////////// /////////////

Call session_start() at the beginning of each(!) page.

>$data = $cart_items;
> session_register('data');

session_register() is deprecated. Simply use the $_SESSION array
instead:

$_SESSION['data'] = $cart_items;

>and this is my php code to get the data
>////////////////////////////////////////////////////////

session_start();

><?php
>foreach ($data as $item)

foreach ($_SESSION['data'] as $item) {
...
}

Also check your error_reporting directive in your php.ini (set it to
E_ALL|E_STRICT) and register_globals (should be off).

Micha
Michael Fesser [ Sa, 19 Januar 2008 11:52 ] [ ID #1912088 ]
PHP » comp.lang.php » Send array from php to php

Vorheriges Thema: No B.S this guy shows the Coolest SEO trick i've seen in a While...
Nächstes Thema: php+fastcgi on Apache