Exemple #1
0
<?php

$error = "";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_SESSION['taikhoan'])) {
    if (isset($_POST['submit'])) {
        if ($_POST['pass'] != "") {
            if ($_POST['pass'] == $_POST['passreplace']) {
                include_once 'objects/taikhoan.php';
                include_once './include/functions.php';
                $taikhoan = unserialize($_SESSION['taikhoan']);
                $tk = TaiKhoan::DoiPass($taikhoan->TenDangNhap, $taikhoan->MatKhau, $_POST['pass']);
                include_once 'logout.php';
                TaiKhoan::DangNhap($taikhoan->TenDangNhap, $_POST['pass']);
                header("location:index.php");
            } else {
                $error = "Nhập sai mật khẩu mới";
            }
        } else {
            $error = "Vui lòng nhập mật khẩu";
        }
    }
}
?>

<form action="" method="POST" id="doimatkhauquen" style="
      padding-top: 100px;
      width: 400px;
      text-align: center;
Exemple #2
0
        } else {
            $erroremail = "Lỗi đổi email!";
        }
    }
    if ($_POST['name'] != "" && $_POST['name'] != $ten) {
        if (TaiKhoan::DoiTenHienThi($taikhoan->ID, $_POST['name'])) {
            $erroremail = "Đổi tên hiển thị thành công ";
            $stylee = 'style="color:green"';
        }
    }
    if ($_POST['matkhaucu'] != "") {
        if (TaiKhoan::DangNhap($taikhoan->TenDangNhap, $_POST['matkhaucu'])) {
            if ($_POST['matkhaumoi'] != "") {
                if ($_POST['matkhaumoi'] == $_POST['nhaplai']) {
                    $matkhaucu = md5($_POST['matkhaucu']);
                    TaiKhoan::DoiPass($taikhoan->TenDangNhap, $matkhaucu, $_POST['matkhaumoi']);
                    $errorpass = "******";
                    $stylep = 'style="color:green"';
                } else {
                    $errorpass = "******";
                }
            } else {
                $errorpass = "******";
            }
        } else {
            $errorpass = "******";
        }
    }
}
?>
<form action="" method="POST" id="doimatkhau">