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_C ows; setuser=>jhough ;
setid=>Junk_Cow s.jhough; locid=>11111111 1; maxloc=>1111111 11; empid=>1;
personal_id=>10 724; administrator=> ; locname=>Benysh ek-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($_SESS ION["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;