1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
session_start(); $u_id = htmlspecialchars($_GET['uid']); $confirm = htmlspecialchars($_POST['confirm']); switch($confirm){ case $u_id: if (isset($_SESSION[$u_id], $_POST[$u_id]) && $_SESSION[$u_id] === $_POST[$u_id]){ unset($_SESSION[$u_id]); }else{ $http = is_ssl() ? 'https' : 'http' . '://'; $url = $http . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; header("Location: ".$url); } break; default: $_POST = array(); $_SESSION = array(); break; } |