예제 #1
0
파일: add.php 프로젝트: KeoSeong/project
$TL = new TimeLine();
try {
    if (isset($_POST['author'])) {
        $author = $_POST['author'];
    }
    if (isset($_POST['content'])) {
        $content = $_POST['content'];
    }
    if (isset($_POST['reply'])) {
        $reply = $_POST['reply'];
    }
    $content = htmlspecialchars($content);
    $tweet = array($author, $content);
    if (isset($userid) && strlen($content) > 0) {
        if (isset($reply)) {
            $TL->addReply($tweet, $reply);
            header("Location:contents.php?reply={$reply}");
            ?>
 
                <?php 
            echo "<script>location.replace(\"contents.php?reply={$reply}\")</script>";
        } else {
            if (!isset($reply)) {
                $TL->addReply($tweet, $reply);
                ?>
                <?php 
                echo "<script>location.replace(\"contents.php\")</script>";
                ?>
 
<?php 
            }