示例#1
0
                    //var_dump($req2->errorInfo());
                    Header(sprintf('Location: ./forum_thread.php?id=%d', $dev->getLastThreadID()));
                }
            } else {
                unset($_SESSION['user']);
                header('Location: ./index.php');
            }
        } else {
            header('Location: ./index.php');
        }
    }
} else {
    if ($from == "remove_msg") {
        if (isset($_SESSION['user'])) {
            if ($dev->isConnected($_SESSION['user']['username'], $_SESSION['user']['password'], $_SESSION['user']['session_id'])) {
                if ($dev->getAdminLevel($dev->getID($_SESSION['user']['username'])) >= 6 || $dev->getMessageAuthor($_GET['id']) == $dev->getID($_SESSION['user']['username'])) {
                    $sql = "DELETE FROM `web_messages` WHERE `id` = " . $_GET['id'] . ";";
                    $db2 = new PDO('mysql:host=' . $mysql_hostname . ';dbname=' . $mysql_database, $mysql_username, $mysql_password);
                    $req2 = $db2->prepare($sql);
                    $req2->execute();
                    Header(sprintf('Location: ./forum_thread.php?id=%d', $_GET['th']));
                }
            } else {
                unset($_SESSION['user']);
                header('Location: ./index.php');
            }
        } else {
            header('Location: ./index.php');
        }
    } else {
        if ($from == "remove_thread") {