Well it looks like the $_POST
superglobal isn't populated (have you checked this?) or, at least, it doesn't contain what you think it does.
Your code seems to be assuming the POST values without checking.
Run print_r($_POST)
- does it contain the right data?