<?php $token = $_POST['token']; require_once 'functions.php'; checkEmptyToken($token); // Instantiate a connection require_once 'connect.php'; global $conn; checkExpiredToken($conn, $token); // Token still exists // Delete the user's token deleteToken($conn, $token); $conn->close(); $response = ["success" => "Logged out"]; echo json_encode($response); die;
$page = $_GET['page']; } else { $page = 1; } $numrows = 20; $data = array('start' => ($page - 1) * $numrows, 'limit' => $numrows); $tokens = getTokens($data); $pagination = new Pagination(); $pagination->total = $total_token; $pagination->page = $page; $pagination->limit = $numrows; $pagination->url = "token/page{page}.html"; $pagination = $pagination->render(); if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['selected'])) { foreach ($_POST['selected'] as $token_id) { $delete_query = deleteToken($token_id); if ($delete_query) { $_SESSION['success'] = $lang['success_delete']; header('Location:tokens.html'); } else { $error_warning = $lang['error_query']; } } } ?> <div id="content"> <div class="breadcrumb"> <a href="home.html"><?php echo $lang['text_home']; ?> </a>