Fix crash on empty form submit
This commit is contained in:
parent
56526cb8ce
commit
761732cd1b
@ -11,8 +11,8 @@ require_once __DIR__ . "/../../lib/requiredpublic.php";
|
|||||||
require_once __DIR__ . "/../../lib/Email.lib.php";
|
require_once __DIR__ . "/../../lib/Email.lib.php";
|
||||||
|
|
||||||
function errorBack(string $errormsg) {
|
function errorBack(string $errormsg) {
|
||||||
global $familyid;
|
global $familyid, $database;
|
||||||
//header("Location: ../?page=signup&error=" . htmlentities($errormsg));
|
header("Location: ../?page=signup&error=" . htmlentities($errormsg));
|
||||||
$database->delete("families", ["familyid" => $familyid]);
|
$database->delete("families", ["familyid" => $familyid]);
|
||||||
die($errormsg);
|
die($errormsg);
|
||||||
}
|
}
|
||||||
@ -31,6 +31,10 @@ $database->action(function($database) {
|
|||||||
|
|
||||||
$emails = [];
|
$emails = [];
|
||||||
|
|
||||||
|
if (!isset($_POST["people"]) || empty($_POST["people"])) {
|
||||||
|
errorBack("You need to register at least one person.");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$people = $_POST['people'];
|
$people = $_POST['people'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user