OK. Then you will want to use the server validation instead of a simple IF statement like you have now.
You will need to:
Move your recordset includes on lines 27-28 to the top of the page.
Then you need to move your rsPresentkort recordset above the server validation code.
Then you would add a server validation rule to validate the value of <?php echo($rsPresentkort->TotalRows); ?> and validate it is a number that is greater than zero.
Then remove the IF statements that currently wrap around your error message and then highlight the message and use the Server Behavior for "Validation Show IF" to show the error if it fails the Total Row validation you added in the previous step.