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

Editing '$defaultEndpoint'

\n"; $html .= "\t\t\t\t
\n"; $html .= "\t\t\t\t\t
\n"; $html .= "\t\t\t\t\t

\n"; $html .= "\t\t\t\t\t
\n"; $html .= "\t\t\t\t\t
\n"; $html .= "\t\t\t\t\t

\n"; $html .= "\t\t\t\t\t
By clicking 'Request changes' you will be submitting your changes, which will (if accepted) replace the current state of the page. It is up to the site moderators and/or administrators to accept or deny this request. Please take the license of the original document into account before submitting any changes. Site moderators and/or administrators reserve the right to deny this request, remove and/or alter the content and if deemed appropriate ban users.\n
"; $html .= "\t\t\t\t
\n"; $html = printFooter($html); print "$html"; ?>