I've got ONE session variable that doesn't seem to want to pass over.
file1.php
<?php
session_start();
$ordertotal = $total + $ship + $tax;
$ordertotal = round($ordertotal,2);
printf ("%01.2f",$ordertotal);
session_register("ordertotal");
print "Ordertotal=$ordertotal";
session_register("foo1");
session_register("foo2");
session_register("foo3");
header ("Location: file2.php");
exit;
?>
file2.php
<?php
session_start();
print "Ordertotal=$ordertotal";
print "Foo1=$foo1";
print "Foo2=$foo2";
print "Foo3=$foo3";
?>
File1 displays:
$29.99
Ordertotal=29.99
File2 displays:
Ordertotal=
Foo1=whatever
Foo2=whatever else
Foo3=whatmnot
Now I realize that this can't run exactly like this, but this is the gist of what I'm doing. The variable $ordertotal just seems to dissappear even though I confirmed it's there just before going into the other module. I checked the punctuation 100 times. What's even weirder, is if I insert:
$ordertotal="29.99";
right before the session_register, it DOES get carried over. This leads me to believe it's something I'm doing in the manipulation of the variable. BTW when I use gettype("ordertotal") I get "string" returned.
Thanks
file1.php
<?php
session_start();
$ordertotal = $total + $ship + $tax;
$ordertotal = round($ordertotal,2);
printf ("%01.2f",$ordertotal);
session_register("ordertotal");
print "Ordertotal=$ordertotal";
session_register("foo1");
session_register("foo2");
session_register("foo3");
header ("Location: file2.php");
exit;
?>
file2.php
<?php
session_start();
print "Ordertotal=$ordertotal";
print "Foo1=$foo1";
print "Foo2=$foo2";
print "Foo3=$foo3";
?>
File1 displays:
$29.99
Ordertotal=29.99
File2 displays:
Ordertotal=
Foo1=whatever
Foo2=whatever else
Foo3=whatmnot
Now I realize that this can't run exactly like this, but this is the gist of what I'm doing. The variable $ordertotal just seems to dissappear even though I confirmed it's there just before going into the other module. I checked the punctuation 100 times. What's even weirder, is if I insert:
$ordertotal="29.99";
right before the session_register, it DOES get carried over. This leads me to believe it's something I'm doing in the manipulation of the variable. BTW when I use gettype("ordertotal") I get "string" returned.
Thanks