Added 'if' to fix the error when $_POST['name'] isn't set.