Posted by Bob Stearns on 12/19/05 08:29
I thought that the given expression was always TRUE if "not_there"
wasn't among the keys (or subscripts if you will) of $_SESSION.
Below find a dump of $_SESSION, a small snippet of code and the results.
I really don't understand. A new pair of eyes may be able to spot what
should be an obvious bug.
Thanks for looking.
_SESSION=array 16 { userid=>bob; setname=>Junk_Cows; setuser=>jhough;
setid=>Junk_Cows.jhough; locid=>111111111; maxloc=>111111111; empid=>1;
personal_id=>10724; administrator=>; locname=>Benyshek-Hough; left=>1;
right=>1152; emp_left=>1; emp_right=>1152; uses_eid=>Y; bhid=>292550; }
$debug .= "<br>date 1=$date; <br>";
if(empty($date)) {
$debug .= "<br>date 2=$date; <br>";
if(empty($_SESSION["sale_date"])) {
$date = date("m-d-Y");
$debug .= "<br>date 3=$date; <br>";
}
else {
$date = $_SESSION["sale_date"];
$debug .= "<br>date 4=$date; <br>";
}
}
$_SESSION["sale_date"] = $date;
$debug .= "<br>date 5=$date; <br>";
date 1=;
date 2=;
date 4=2;
date 5=2;
[Back to original message]
|