if ($var)is a very messy way to check a value.
Here's why:
if (X) will return true unless X is (1) 0, (2) FALSE, (3) '' (empty string), (4) null; (5) not set*, and possibly other cases that I'm not remembering
*However, this will also give a warning about using a variable that doesn't exist.
There are better ways to do this, and one is:
if (isset($var))
The best way to debug this and to determine what sort of if statement you need is to just useecho $_POST["count"];(immediately before the if statement).
Then you can decide what to do.

