Example #1
1
    if (isset($_POST['sql'])) {
        $sql = $_POST['sql'];
        $result = $conn->query($sql);
        $tout = '';
        while ($line = $result->fetch_assoc()) {
            $out = '[';
            foreach ($line as $k => $v) {
                $out .= "'{$k}': '{$v}', ";
            }
            $out = substr($out, 0, -2);
            $out .= "], \n";
            $tout .= $out;
        }
        $tout = substr($tout, 0, -3) . "\n";
        echo "{$tout}";
    }
    ?>
</textarea>
        </form>
      <?php 
} else {
    ?>
        <h1 class="nomp">Hello <?php 
    echo $username;
    ?>
</h1>
        <span class="bold">You're not an admin, so what are you doing here?</span>
      <?php 
}
echo postMain();
Example #2
0
if (isset($_POST['errid']) && isset($_POST['status'])) {
    // Get error data
    $errid = $_POST['errid'];
    $status = $_POST['status'];
    // Use colours when HTML
    if ($html) {
        if (str_starts_with($status, 'OK~ ')) {
            OK();
        } else {
            if (str_starts_with($status, 'D~ ')) {
                D();
            } else {
                if (str_starts_with($status, 'W~ ')) {
                    W();
                } else {
                    if (str_starts_with($status, 'E~ ')) {
                        E();
                    }
                }
            }
        }
        $status = explode('~', $status, 2)[1];
    }
    $errmsg = $status . ($errid == 0 ? "" : "[{$errid}]");
    echo htmlspecialchars($errmsg);
    $html && N();
}
if ($html) {
    postMain();
}
unset($ATERR);