PHP 5.3, Win 7, XAMPP 1.7.3 (Apache local server)
I need a further education on using sessions and variable assignments.
I have successfully used, for example, " $SESSION["d"] = $d;" to assign one variable and I can retrieve it easily enough on other pages with
"if ($code != $SESSION["d"]) { ... and it works well, regardless of what page it is, as long as I remember the session_start on such pages.
However, and this is where I get confused:
I cannot Echo "$_SESSION["d"]) and have it not throw an error such as "Notice: Undefined variable: email in ... "
Now, if I try to add another sessions variable such as
"if ($email=$_SESSION["e"]){
echo "$email . "<br />"; }
nothing happens; no error, nothing echoed, etc., to show me that it worked. e.g.
if ($email=$_SESSION["e"]){
echo "$email . "<br />"; }
else {
echo "There was no echo.";
}
Same thing: nothing echose, no errors, nothing.
Basically, why can't I echo a session variable? I know it's cockpit error, but ... what is it I don't understand?
I already have a thread open in Newbies and plan to add this there, too; but for general information, I've found this group is better because of explaining things more generally.
TIA,
Rivet`:eek: