After calling the redirect function header, should I call exit or not?
<?php // fileA
$urlFailToGoTo = '/formerror.php';
header(sprintf("Location: %s", $urlFailToGoTo));
exit(); //should I call exit() here? or return?
You definitely should. Otherwise the script execution is not terminated. Setting another header alone is not enough to redirect.