Example #1
0
<?php

require_once "../Utility/databaseZalando.php";
$db = new databaseZalando();
$db->connetti();
$nome = $_POST["label_nome"];
$cognome = $_POST["label_cognome"];
$email = $_POST["label_email"];
$psw = MD5($_POST["label_password"]);
$old_email = $_POST["old_email"];
//Amministratore?
try {
    $db->exec("DELETE FROM Utente where email = {$old_email}");
    $res = $db->exec("INSERT INTO Utente(nome, cognome, email, password, newsletter) VALUE('{$nome}', '{$cognome}', '{$email}', '{$psw}', 'no');");
} catch (DataseException $e) {
    if ($e . geterrno() == 2) {
        echo $e . log();
    }
}
$db->disconnetti();
if ($res) {
    echo "Utente creato correttamente";
} else {
    echo "Utente NON creato";
}
Example #2
0
<?php

require_once "../Utility/databaseZalando.php";
$db = new databaseZalando();
$db->connetti();
$email = $_POST["user"];
var_dump($email);
try {
    //$res = $db->exec("delete from Utente where email = $email;");
} catch (DataseException $e) {
    echo $e->log();
}
$db->disconnetti();