Fix errors about uninitialized variables

This commit is contained in:
Michael Erdely 2024-10-09 18:52:37 -04:00
parent d16d20afb5
commit d550765405
2 changed files with 10 additions and 2 deletions

View file

@ -38,6 +38,8 @@ $action = empty($_GET["action"]) ? "" : $_GET["action"];
if (!empty($_GET["familyid"])) if (!empty($_GET["familyid"]))
$familyid = (int) $_GET["familyid"]; $familyid = (int) $_GET["familyid"];
else
$familyid = 1;
if ($action == "insert" || $action == "update") { if ($action == "insert" || $action == "update") {
/* validate the data. */ /* validate the data. */

View file

@ -18,6 +18,10 @@ require_once(dirname(__FILE__) . "/includes/MySmarty.class.php");
$smarty = new MySmarty(); $smarty = new MySmarty();
$opt = $smarty->opt(); $opt = $smarty->opt();
if (!isset($username)) $username = "";
if (!isset($fullname)) $fullname = "";
if (!isset($email)) $email = "";
if (isset($_POST["action"]) && $_POST["action"] == "signup") { if (isset($_POST["action"]) && $_POST["action"] == "signup") {
$username = isset($_REQUEST["username"]) ? $_POST["username"] : ""; $username = isset($_REQUEST["username"]) ? $_POST["username"] : "";
$fullname = isset($_REQUEST["fullname"]) ? $_POST["fullname"] : ""; $fullname = isset($_REQUEST["fullname"]) ? $_POST["fullname"] : "";
@ -110,7 +114,9 @@ $smarty->assign('fullname', $fullname);
$smarty->assign('email', $email); $smarty->assign('email', $email);
$smarty->assign('familyid', $familyid); $smarty->assign('familyid', $familyid);
$smarty->assign('familycount', count($families)); $smarty->assign('familycount', count($families));
if (isset($_POST["action"])) {
$smarty->assign('action', $_POST["action"]); $smarty->assign('action', $_POST["action"]);
}
if (isset($error)) { if (isset($error)) {
$smarty->assign('error', $error); $smarty->assign('error', $error);
} }