query_fetchDB(" SELECT user_realname FROM ot_users WHERE user_code = '" . addslashes($_GET['user_code']) . "' && user_status = 'activation' LIMIT 1 "); // Fetch user from DB if($User) // User exists? { if($_SERVER['REQUEST_METHOD'] == "POST") // Activate? { if( ! empty($_POST['active_password'])) // Field is set? { $User = $DB->query_execDB(" UPDATE ot_users SET user_password = '" . md5(addslashes($_POST['active_password'])) . "', user_status = 'active' WHERE user_code = '" . $_GET['user_code'] . "' LIMIT 1 "); // Update user header("Location: login.php"); // Go to login-page } else // Not correctly { define("FORM_ERROR", "Gelieve alle velden correct in te vullen."); } } ?>