Re: [PHP] Argh! nulls un stuff..

2002-10-15 Thread Francis
i think that was one of the problems, some places the session var was set back as a string ("0") and other as int (0). anyway thanks to all, panic over all working now :) "Jason Young" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > My suggestion would be to c

Re: [PHP] Argh! nulls un stuff..

2002-10-14 Thread Jason Young
My suggestion would be to checck for isset($_SESSION["temp"]) and if ($_SESSION["temp"] > "0") with quotes .. PHP is very forgiving with data types, and I've found its much easier to keep track of what exactly is going on if I reference everything in a string format. -Jason Sam Masiello wrote

RE: [PHP] Argh! nulls un stuff..

2002-10-14 Thread Sam Masiello
How about something like this: if ($_SESSION["temp"] > 0) ? Or if you want to be really sure: if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "") ORif you want to be sure the value is a number as well: if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "" && is_numeric($_SESSION["temp"]

RE: [PHP] Argh! nulls un stuff..

2002-10-14 Thread Matt Giddings
if( !empty($_SESSION["temp"])&& is_numeric($_SESSION["temp"]) && $_SESSION["temp"] >= 0 ) { ... } Something like this may work, first check to see if its not empty, then numeric, then if its greater than or equal to 0. If all three conditions are true then it'll execute the "..." block. Plea

Re: [PHP] Argh! nulls un stuff..

2002-10-14 Thread Maxim Maletsky
$var = 0; if(!is_int($var)) { echo '$var isn\'t numeric'; } and simple 'not' is going to ignore '0'. To check wherther a value is an integer use is_int() or is_numeric(), which are the same things anyway. If you care that the value is also higher than '0' add [ and $var>0] as the secon