LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

CSS
prepare($sql);
    $stmt->bindParam(":id", $_SESSION['user']['id']);
    $stmt->bindParam(":password", $_POST['pwd']);
    $stmt->bindParam(":aesKey", $aes_kluc);
    $stmt->setFetchMode(PDO::FETCH_OBJ);
    $stmt->execute();

    if (intVal($stmt->fetch()->pocet) == 1)
        {
            $sql = "UPDATE uzivatelia SET meno = :meno, priezvisko = :priezvisko, email = :email, heslo=AES_ENCRYPT(:password, :aesKey) WHERE id = :id";
            $stmt = $pdo->prepare($sql);
            $stmt->bindParam(":id", $_SESSION['user']['id']);
            $stmt->bindParam(":meno", $_POST['meno']);
            $stmt->bindParam(":priezvisko", $_POST['priezvisko']);
            $stmt->bindParam(":email", $_POST['email']);
            $stmt->bindParam(":password", $_POST['pwd-new']);
            $stmt->bindParam(":aesKey", $aes_kluc);
            $stmt->setFetchMode(PDO::FETCH_OBJ);
            $stmt->execute();

            userSession($_SESSION['user']['id'], $_POST['meno'], $_POST['priezvisko'], $_POST['email']);
            echo 'vase udaje boli uspesne aktualizovane';
            header( "refresh:3; url= uzivatel.php" );
            die();


    }

    else {
        echo 'nespravne heslo';
        header( "refresh:3; url= uzivatel.php" );
        die();
        }

}
else {
    //nezadal heslo aktualizujeme iba ostatne veci
    $sql = "UPDATE uzivatelia SET meno = :meno, priezvisko = :priezvisko, email = :email WHERE id = :id";
    $stmt = $pdo->prepare($sql);
    $stmt->bindParam(":id", $_POST['id']);
    $stmt->bindParam(":meno", $_POST['meno']);
    $stmt->bindParam(":priezvisko", $_POST['priezvisko']);
    $stmt->bindParam(":email", $_POST['email']);
    $stmt->setFetchMode(PDO::FETCH_OBJ);
    $stmt->execute();


    userSession($_SESSION['user']['id'], $_POST['meno'], $_POST['priezvisko'], $_POST['email']);
    echo 'Vase udaje boli uspesne aktualizovane';
    header( "refresh:3; url= uzivatel.php" );
    die();

}

Term
Wed, 12/27/2017 - 06:59

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv