|
Posted by Baeribeeri on 04/09/07 12:28
I am writing a foto upload site. A PHP page displays the uploades
fotos an the customer can choose several things. The data of the fotos
are kept in an array called bilder. I keep the data in a session. When
the customer send the data the following code will be run:
if (isset($sendorder_x))
{
session_start();
$nachricht = $bemerkungen;
session_register(nachricht);
// echo "1.: ";
// print_r($bilder); // The array still exists in the session file
// echo "<br>\n2.: ";
for ($i = 1; $i <= $bildanzahl; $i++)
{
$formatname = "formate" . substr("00" . $i, -2);
$copyname = "copy" . substr("00" . $i, -2);
$bilder[$i]->format = $$formatname;
$bilder[$i]->anzahl = $$copyname;
}
// print_r($bilder); // bilder[] exists with the changed data in the
session file
// echo "<br>\n3.: ";
$briefporto = $porto;
session_register(briefporto);
// session_register(bilder);
// print_r($bilder);
// exit(); // bilder[] exists with the changed data in the session
file
// echo "<br>\n";
header("Location: datenupdate.php");
}
The page datenupdate.php starts with the fololwing code:
<?php
session_start();
// print_r($bilder);
// exit(); // all data is in the session file, but the array bilder[]
is empty now!
include ("database.php");
$dbid = connect();
.....
You can read in the comments, what happens. The lines, which start
with commenst, are for debugging.
Has anyone an idea, what the reason for tis behavior is? BTW, I use
PHP 5.1.4, Apache Server 2 on WinXP prof. SP2
And: This is no Easter Egg :-).
Have a nice spring, Hartmut
[Back to original message]
|