Example #1
0
        } else {
            // ∵새로 올라올 글의 번호를 생성
            $result = mysql_query("select * from socg_facebook_page order by no desc", $dbcon);
            $row = mysql_fetch_array($result);
            // ∵새로운 레코드 입력
            $sql = "insert into socg_facebook_page values ('','{$w_time}','{$id}','{$brand_name}','{$category}','{$likes}','{$rating}','{$on_welcome}','{$on_intro}','{$on_blog}','{$on_twitter}','{$on_video}','{$on_event}','{$on_gallery}','{$on_map}','{$on_app}','{$on_template}','{$on_etc}','{$comment}','{$ip}')";
            $result = mysql_query($sql, $dbcon);
            mysql_close($dbcon);
            // 글 작성 후 액션
            echo "\n\t\t\t<script language='javascript'>\n\t\t\t\twindow.alert( '등록완료.' );\n\t\t\t\tlocation='/facebook';\n\t\t\t</script>\n\t\t";
        }
    }
    // 글수정 모드!!
    if ($_POST[mode] == "modify") {
        // ∵새로 올라올 글의 번호를 생성
        $result = mysql_query("select * from socg_facebook_page order by no desc", $dbcon);
        $row = mysql_fetch_array($result);
        // ∵새로운 레코드 입력
        $sql = "update socg_facebook_page set date = '{$w_time}', id='{$id}', brand_name='{$brand_name}', category='{$category}', likes='{$likes}', rating='{$rating}', on_welcome='{$on_welcome}', on_intro='{$on_intro}', on_blog='{$on_blog}',on_twitter='{$on_twitter}',on_video='{$on_video}', on_event='{$on_event}', on_gallery='{$on_gallery}', on_map='{$on_map}', on_app='{$on_app}', on_template='{$on_template}', on_etc='{$on_etc}', comment='{$comment}', ip='{$ip}' where no='{$_POST['no']}'";
        $result = mysql_query($sql, $dbcon);
        mysql_close($dbcon);
        // 글 작성 후 액션
        echo "\n\t\t\t<script language='javascript'>\n\t\t\t\twindow.alert( '수정완료.' );\n\t\t\t\thistory.go(-2);\n\t\t\t\t//location='index.php';\n\t\t\t</script>\n\t\t";
    }
    // 글삭제 모드!!
    if ($_GET[mode] == "delete") {
        $sql = "delete from socg_facebook_page where no='{$no}'";
        mysql_query($sql, $dbcon) or ALERT('게시물 삭제 실패');
        echo "\n\t\t\t<script language='javascript'>\n\t\t\t\twindow.alert( '정상적으로 삭제되었습니다.' );\n\t\t\t\thistory.go(-2);\n\t\t\t\t//location='index.php';\n\t\t\t</script>\n\t\t";
    }
}
Example #2
0
     }
 }
 // 글삭제 모드!!
 if ($_POST[mode] == "delete") {
     $result = mysql_query("select * from {$_GET['id']} where no='{$_POST['no']}'", $dbcon);
     $row = mysql_fetch_array($result);
     $result2 = mysql_query("select password('{$_POST['pass']}')");
     $pass = mysql_result($result2, 0, 0);
     if ($pass == $row[pass] || $_SESSION[level] == "1") {
         @unlink("upload/{$_GET['id']}/{$row['upload']}");
         // 업로드된 자료 삭제
         $sql = "delete from {$_GET['id']} where no='{$_POST['no']}'";
         mysql_query($sql, $dbcon) or ALERT('게시물 삭제 실패');
         echo "\n\t\t\t\t<script language='javascript'>\n\t\t\t\t\t//window.alert( '정상적으로 삭제되었습니다.' );\n\t\t\t\t\tlocation='list.php?id={$_GET['id']}';\n\t\t\t\t</script>\n\t\t\t";
     } else {
         ALERT("비밀번호가 맞지 않습니다.");
     }
 }
 // 답변 모드!!
 if ($_POST[mode] == "reply") {
     if ($_FILES[upload][name]) {
         $dir = "upload/{$_GET['id']}/";
         // 자료가 저장될 폴더
         $upload = $HTTP_POST_FILES['upload']['name'];
         // 글 등록 시간과 파일 이름 합성해서 변수 만듦.
         $upload = uniq_name($upload, $dir);
         if (!is_uploaded_file($file = $HTTP_POST_FILES['upload']['tmp_name'])) {
             echo "file upload error!!";
         } else {
             if (!move_uploaded_file($file, $dir . $upload)) {
                 echo "file copy error";