getToken(); $_SESSION['token'] = $token; } $_SESSION['admin-uuid'] = $cryptography->uniqueID(); if(!isset($_SESSION['admin-uuid']) || empty($_SESSION['admin-uuid'])) { header("location: ../error/3/"); exit; } // create a new admin token if(!isset($_SESSION['uuid'])) { $token = $cryptography->uniqueID(); $token .= $cryptography->uniqueID(); $token .= $cryptography->uniqueID(); $token .= $cryptography->uniqueID(); $_SESSION['uuid'] = $token; } else { $token = $_SESSION['uuid']; } if(isset($_REQUEST['delete'])) { if($_SESSION['uuid'] === $_REQUEST['csrf']) { $result = $db->delete('components',$db->intcast($_REQUEST['delete'])); } header("Location: ../../../../index.php"); exit; } $result = $db->query("SELECT * FROM components order by id DESC"); ?>
database edit delete