$nameError = $regMod->InputName($_POST['firstName'] . " " . $_POST['lastName']); } if (isset($_POST['username'])) { $usernameError = $regMod->InputUsername($_POST['username']); } if (isset($_POST['password']) || isset($_POST['passwordAgain'])) { $passwordError = $regMod->InputPassword($_POST['password'], $_POST['passwordAgain']); } if (isset($_POST['email'])) { $emailError = $regMod->InputEmail($_POST['email'], $_POST['email']); } if (isset($_POST['captcha_code'])) { if ($securimage->check($_POST['captcha_code']) == true) { if ($regMod->RequestConfirmation()) { //ConfirmUser is the function that will use the confirm code later. Once the confirm code is ready, a variable will be added to be given to the function for use $regMod->ConfirmUser(); echo '<meta http-equiv="REFRESH" content="0;url=registrationSuccess.php"></HEAD>'; //TODO redirect to registration sucessful page } } else { $catpchaError = "The code did not match. Try Again"; } } function checkIsset($str) { if (isset($str)) { echo $str; } else { return ""; } }
<?php include 'header.php'; include_once 'RegistrationModule.php'; include_once 'RegistrationModule.php'; include_once 'DatabaseModule.php'; $dbMod = new DatabaseModule(); $connection = $dbMod->connect(); $regMod = new RegistrationModule($connection); $result = false; if (isset($_GET["registrationId"])) { $result = $regMod->ConfirmUser($_GET["registrationId"]); } ?> <div class="container"> <center><?php if ($result) { echo "Successfully registered"; } else { echo "Invalid registration key"; } ?> </center> </div> <?php include 'footer.php';