Some versions of XAMPP include a version of PHP that is incompatible with NetBeans IDE. In particular, it seems that the fgets() PHP statement times out after about 30 seconds and the flow of execution continues to the next statements regardless of the fact that the user may or may not enter a value.

Hopefully, this problem no longer exist  in version 7.x of XAMPP !!!