This is because you can't put code for condition checking inside code for popup notification. Properly would be like this: Please login or register to see this code.