Beispiel #1
0
 } else {
     if (isset($_POST["name"]) && isset($_POST["pass"]) && isset($_POST["email"]) && isset($_POST["phone"])) {
         //Editar perfil populat
         $popular = array();
         $popular["name"] = $_POST["name"];
         $popular["pass"] = $_POST["pass"];
         $popular["email"] = $_POST["email"];
         $popular["phone"] = $_POST["phone"];
         $p = new Popular();
         $boolean = $p->isValid($popular);
         if ($boolean == false) {
             $msg = "User already exists";
             header("Location: ../views/signIn.php?msg={$msg}");
         } else {
             $id = $_SESSION["name"];
             $bool = $p->update($popular, $id);
             if ($bool == true) {
                 $_SESSION["name"] = $popular["name"];
                 $msg = "Your profile was updated";
                 header("Location: ../views/signIn.php?msg={$msg}");
             } else {
                 $msg = "Server error. Try again";
                 header("Location: ../views/editProfileProfessional.php?msg={$msg}");
             }
         }
     } else {
         if (isset($_POST["idp2"])) {
             $idp2 = $_POST["idp2"];
             $ide2 = $_POST["ide2"];
             $idpop2 = $_POST["idpop2"];
             $code21 = $_POST["code21"];