query('SELECT * FROM users'); while ($line = $DatabaseQuery->fetchArray()) { if ($line['username'] == htmlspecialchars($_SESSION['username']) && $_SESSION['username'] != "" && $line['password'] == htmlspecialchars($_SESSION['password']) && htmlspecialchars($_SESSION['password']) != "") { $Authorized = true; break; } } // not authorized if ($Authorized != true) { header('Location: /'); die(); } $defaultText = ""; $defaultEndpoint = ""; $DatabaseQuery = $Database->query('SELECT * FROM pages'); while ($line = $DatabaseQuery->fetchArray()) { if ($line['id'] == $postID && $postID != -1) { $theFile = $line['file']; if (file_exists($theFile)) { $defaultText = file_get_contents($theFile); } else { header("Location: /"); die(); } $defaultEndpoint = $line['endpoint']; break; } } if ($defaultEndpoint == "") { header("Location: /"); die(); } $html = ""; $html = printHeader($html, 0); $html .= "\t\t\t