Here is a full example of the snippet:
if(!empty($_GET['zip']) || !empty($_GET['r'])) {
// code to run this page goes here
} else {
// Redirect to another page
header("Location: https://oursite.com/other-page/");
exit();
}
My page runs fine and there is nothing wrong with my code. The problem is that when I try to move the code into a snippet (out of the insert_sql tags), the save procedure runs the code and therefore redirects before the save happens.