Creata la pagina per registrare i rinnovi

This commit is contained in:
root 2016-10-16 20:18:31 +02:00
parent a7de9454ae
commit e776d41d95

View file

@ -1,3 +1,37 @@
<?php
include_once 'config/config.php';
include_once "vendor/notorm/NotORM.php";
$pdo = new PDO("mysql:host=".$db_host.";dbname=".$db_dbname,
$db_user,
$db_pass
);
$db = new NotORM($pdo);
if( isset($_GET['token']) && !empty($_GET['token']) &&
isset($_GET['ml']) && !empty($_GET['ml']) &&
isset($_GET['email']) && !empty($_GET['email']) ) {
$token = $_GET['token'];
$ml = $_GET['ml'];
$email = $_GET['email'];
$affected = $db->$db_table()->where(array(
"token" => $token,
"ml" => $ml,
"email" => $email
))->update(array(
"renewed" => 1,
));
if($affected == 1) {
echo "Hai rinnovato l'inscrizione.";
} else {
echo "Si è verificato un errore.";
}
}
?>