Beispiel #1
0
 // get out the value of the port array
 $key = $_POST["key"];
 $value = $_POST["value"];
 // include the Matchup classes
 require_once 'Matchup.inc.php';
 // create an object of MUUsers
 $user = new MUUsers();
 // select which is the case here and what to do
 switch ($key) {
     case "nome":
         // update the name
         $user->changeName($_SESSION["username"], $value);
         break;
     case "cognome":
         // update the surname
         $user->changeSurname($_SESSION["username"], $value);
         break;
     case "password":
         // update the password
         $user->changePassword($_SESSION["username"], $value);
         break;
     default:
         // redirect to home.php and exit the script
         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;