37 lines
690 B
PHP
37 lines
690 B
PHP
<?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.";
|
|
}
|
|
}
|
|
|
|
?>
|