the code order:
1) SA Server Validation
2) Recordset
3) Insert behavior
needs to be:
1) Recordset
2) SA Server Validation
3) Insert behavior
the problem is that you are using the $totalRows_rsCheckEmail variable in the server validation, before it has been created.
with the code in the current order:
1) SA Server Validation - uses $totalRows_rsCheckEmail varaibel
2) Recordset - creates $totalRows_rsCheckEmail varaible
3) Insert behavior
you can see that the $totalRows_rsCheckEmail variable is being used before it is created.
the recordset needs to come first so that the $totalRows_rsCheckEmail variable exists when the Server validation code tries to use it.