Beispiel #1
0
            header("location: home.php");
            exit;
            break;
    }
    // take out the updated information from the database
    $newUser = $user->getInformationAboutUser($_SESSION["username"]);
    // reset the session array
    $_SESSION = $newUser;
    // redirect to the home.php and exit the script
    header("location: home.php");
    exit;
} else {
    if (isset($_POST["enable"])) {
        // get out the value from the post array
        $newValue = $_POST["value"];
        $username = $_POST["username"];
        // require the file with all the classes
        require_once 'Matchup.inc.php';
        // create an object of MUUsers
        $user = new MUUsers();
        // update the enable state
        $user->changeEnableState($username, $newValue);
        // redirect the user to the home.php page and exit the script
        header("location: home.php");
        exit;
    } else {
        // redirect user to index.php file
        header("location: index.php");
        exit;
    }
}