You are here: My mind is going? empty($_SESSION["not_there"]) « PHP Programming Language « IT news, forums, messages
My mind is going? empty($_SESSION["not_there"])

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;

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация