<?php
//제 게시판이 utf-8입니다.
//윈도우서버인데. 윈도우서버는 기본이 euckr인가 봅니다.
//lib.parse.php 는 제일 하단에 기재 하겠습니다.
//mb_id, mb_name, mb_password, mb_email 의 내용만 자신의 것으로 만드시면 됩니다.
//bo_table의 값을 해당 게시판으로 지정하시면 됩니다.
//dir 는 파일이 위치한 디렉토리 입니다.
header("Content-type:text/html;charset=utf-8");
include_once './_common.php';
include_once $g4['path'].'/lib/lib.parse.php';
//게시판의 이름을 지정합니다.
$bo_table= 'adult1';
$html = 'html1';
$write_table ="g4_write_$bo_table";
//실제로 읽어 들일 디렉토리의 경로입니다.
$dir = $g4['path'].'/softmovie4/';
$dr = opendir($dir);
if($dr == true):
while(($file = readdir($dr)) ==true):
$src_file = $dir.$file;
if($file == '' || $file == '.' || $file == '..' || is_file($src_file) == false)
continue;
$file = iconv("euc-kr", "utf-8",$file);
$dest_name = get_unique_file($file);
$file = urldecode($file);
$save_files = $dest_name;
//파일을 지정할 경로
$file_name = $g4['path']."/data/file/$bo_table/$save_files";
@copy($src_file, $file_name);
if(is_file($file_name)==false)
continue;
$upload[0]['image'] = $g4['path']."/data/file/$bo_table/$save_files";
$upload[0][source] = $file;
$upload[0][filesize] = filesize($upload[0]['image']);
$upload[0][file] = $save_files;
/** 디비에 입력하는 부분 ****/
$wr_num = get_next_num($write_table);
$wr_reply = "";
$save_title = addslashes(strip_tags($file));
$wr_subject= $save_title;
$wr_content = $save_title;
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_trackback = '$wr_trackback',
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = 'admin_id',
wr_password = 'admin_password',
wr_name = 'admin_name',
wr_email = 'adin_email',
wr_homepage = '',
wr_datetime = now(),
wr_last = now(),
wr_ip = '$_SERVER[REMOTE_ADDR]',
wr_1 = '$file',
wr_2 = '$wr_2',
wr_3 = '$wr_3',
wr_4 = '$wr_4',
wr_5 = '$wr_5',
wr_6 = '$wr_6',
wr_7 = '$wr_7',
wr_8 = '$wr_8',
wr_9 = '$wr_9',
wr_10 = '$wr_10' ";
$que_result = @mysql_query($sql);
if($que_result=true):
$wr_id = mysql_insert_id();
$sql = " insert into g4_board_file
set bo_table = '$bo_table',
wr_id = '$wr_id',
bf_no = '0',
bf_source = '{$upload[0][file]}',
bf_file = '{$upload[0][file]}',
bf_content = '{$bf_content[0]}',
bf_download = 0,
bf_filesize = '{$upload[0][filesize]}',
bf_width = '{$upload[0][image][0]}',
bf_height = '{$upload[0][image][1]}',
bf_type = '{$upload[0][image][2]}',
bf_datetime = '$g4[time_ymdhis]' ";
mysql_query($sql);
// 부모 아이디에 UPDATE
mysql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");
// 새글 INSERT
//sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]' ) ");
mysql_query(" insert into g4_board_new ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]', '$member[mb_id]' ) ");
// 게시글 1 증가
mysql_query("update g4_board set bo_count_write = bo_count_write + 1 where bo_table = '$bo_table'");
endif;
endwhile;
closedir($dr);
endif;
?>
/lib.parse.php 의 내용
<?php
//파일의 확장자를 구하는 함수
function get_extension($file){
return strtolower(substr(strrchr($file,"."),1));
//파일의 확장자를 구하는 함수
$info = @getimagesize($file);
if(!$info)
return '';
switch($info[2]) {
case 1:
return 'gif';break;
case 2:
return 'jpg';break;
case 3:
return 'png';break;
case 4:
return 'zip';break;
case 5:
return 'hwp';break;
case 6:
return 'doc';break;
case 7:
return 'xls';break;
case 8:
return 'ppt';break;
default :
return '';
}
}
//임시 번호를 생성하는 함수
function get_unique_code($prefix = ""){
$prefix = $prefix ? $prefix : "mk_";
return $prefix.mt_rand(10000, 99999).'_'.mt_rand(10000, 99999);
}
function get_unique_file($file){
$ext =get_extension($file);
$code= get_unique_code();
return $code.'.'.$ext;
}
//flag는 리눅스 인지, 윈도우인지, 리눅스의 경우 false, 윈도우의 경우 true
function fsockopen_func($url) {
$url_arr = parse_url($url);
$request = $url_arr['host'];
$get_value = $url_arr['path'].'?'.$url_arr['query'];
$fp = fsockopen($request, 80, $errno, $errstr, 3);
if (!$fp) {
return false;
} else {
$out = "GET $get_value HTTP/1.1\r\n";
$out .= "Host: $request\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$content .= fgets($fp, 128);
}
fclose($fp);
$content_arr = explode("\r\n\r\n", $content);
if($content_arr[1] ==false)
return '';
else
return $content_arr[1];
}
}
//잡코리아를 파싱하는 경우
function fsockopen_func_jobkorea($url, $flag= true) {
$url_arr = parse_url($url);
$request = $url_arr['host'];
$get_value = $url_arr['path'].'?'.$url_arr['query'];
$fp = @fsockopen($request, 80, $errno, $errstr, 5);
if (!$fp) {
return '';
} else {
$out = "GET $get_value HTTP/1.1\r\n";
$out .= "Host: $request\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$content .= fgets($fp, 128);
}
fclose($fp);
if(preg_match("/HTTP\/1\.1 200/", $content)==false)
return '';
//echo "done";
$content_arr = explode("\r\n", $content);
return $content_arr;
}
}
//알바몬을 파싱하는 경우
function fsockopen_func_albamon($url, $flag= true) {
$url_arr = parse_url($url);
$request = $url_arr['host'];
$get_value = $url_arr['path'].'?'.$url_arr['query'];
$fp = @fsockopen($request, 80, $errno, $errstr, 5);
if (!$fp) {
return false;
} else {
$out = "GET $get_value HTTP/1.1\r\n";
$out .= "Host: $request\r\n";
$out.= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$content .= fgets($fp, 128);
}
fclose($fp);
if(preg_match("/HTTP\/1\.1 200/", $content)==false)
return '';
$content_arr = explode("<?xml", $content);
return $content_arr[1];
}
}
?><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
//제 게시판이 utf-8입니다.
//윈도우서버인데. 윈도우서버는 기본이 euckr인가 봅니다.
//lib.parse.php 는 제일 하단에 기재 하겠습니다.
//mb_id, mb_name, mb_password, mb_email 의 내용만 자신의 것으로 만드시면 됩니다.
//bo_table의 값을 해당 게시판으로 지정하시면 됩니다.
//dir 는 파일이 위치한 디렉토리 입니다.
header("Content-type:text/html;charset=utf-8");
include_once './_common.php';
include_once $g4['path'].'/lib/lib.parse.php';
//게시판의 이름을 지정합니다.
$bo_table= 'adult1';
$html = 'html1';
$write_table ="g4_write_$bo_table";
//실제로 읽어 들일 디렉토리의 경로입니다.
$dir = $g4['path'].'/softmovie4/';
$dr = opendir($dir);
if($dr == true):
while(($file = readdir($dr)) ==true):
$src_file = $dir.$file;
if($file == '' || $file == '.' || $file == '..' || is_file($src_file) == false)
continue;
$file = iconv("euc-kr", "utf-8",$file);
$dest_name = get_unique_file($file);
$file = urldecode($file);
$save_files = $dest_name;
//파일을 지정할 경로
$file_name = $g4['path']."/data/file/$bo_table/$save_files";
@copy($src_file, $file_name);
if(is_file($file_name)==false)
continue;
$upload[0]['image'] = $g4['path']."/data/file/$bo_table/$save_files";
$upload[0][source] = $file;
$upload[0][filesize] = filesize($upload[0]['image']);
$upload[0][file] = $save_files;
/** 디비에 입력하는 부분 ****/
$wr_num = get_next_num($write_table);
$wr_reply = "";
$save_title = addslashes(strip_tags($file));
$wr_subject= $save_title;
$wr_content = $save_title;
$sql = " insert into $write_table
set wr_num = '$wr_num',
wr_reply = '$wr_reply',
wr_comment = 0,
ca_name = '$ca_name',
wr_option = '$html,$secret,$mail',
wr_subject = '$wr_subject',
wr_content = '$wr_content',
wr_link1 = '$wr_link1',
wr_link2 = '$wr_link2',
wr_link1_hit = 0,
wr_link2_hit = 0,
wr_trackback = '$wr_trackback',
wr_hit = 0,
wr_good = 0,
wr_nogood = 0,
mb_id = 'admin_id',
wr_password = 'admin_password',
wr_name = 'admin_name',
wr_email = 'adin_email',
wr_homepage = '',
wr_datetime = now(),
wr_last = now(),
wr_ip = '$_SERVER[REMOTE_ADDR]',
wr_1 = '$file',
wr_2 = '$wr_2',
wr_3 = '$wr_3',
wr_4 = '$wr_4',
wr_5 = '$wr_5',
wr_6 = '$wr_6',
wr_7 = '$wr_7',
wr_8 = '$wr_8',
wr_9 = '$wr_9',
wr_10 = '$wr_10' ";
$que_result = @mysql_query($sql);
if($que_result=true):
$wr_id = mysql_insert_id();
$sql = " insert into g4_board_file
set bo_table = '$bo_table',
wr_id = '$wr_id',
bf_no = '0',
bf_source = '{$upload[0][file]}',
bf_file = '{$upload[0][file]}',
bf_content = '{$bf_content[0]}',
bf_download = 0,
bf_filesize = '{$upload[0][filesize]}',
bf_width = '{$upload[0][image][0]}',
bf_height = '{$upload[0][image][1]}',
bf_type = '{$upload[0][image][2]}',
bf_datetime = '$g4[time_ymdhis]' ";
mysql_query($sql);
// 부모 아이디에 UPDATE
mysql_query(" update $write_table set wr_parent = '$wr_id' where wr_id = '$wr_id' ");
// 새글 INSERT
//sql_query(" insert into $g4[board_new_table] ( bo_table, wr_id, wr_parent, bn_datetime ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]' ) ");
mysql_query(" insert into g4_board_new ( bo_table, wr_id, wr_parent, bn_datetime, mb_id ) values ( '$bo_table', '$wr_id', '$wr_id', '$g4[time_ymdhis]', '$member[mb_id]' ) ");
// 게시글 1 증가
mysql_query("update g4_board set bo_count_write = bo_count_write + 1 where bo_table = '$bo_table'");
endif;
endwhile;
closedir($dr);
endif;
?>
/lib.parse.php 의 내용
<?php
//파일의 확장자를 구하는 함수
function get_extension($file){
return strtolower(substr(strrchr($file,"."),1));
//파일의 확장자를 구하는 함수
$info = @getimagesize($file);
if(!$info)
return '';
switch($info[2]) {
case 1:
return 'gif';break;
case 2:
return 'jpg';break;
case 3:
return 'png';break;
case 4:
return 'zip';break;
case 5:
return 'hwp';break;
case 6:
return 'doc';break;
case 7:
return 'xls';break;
case 8:
return 'ppt';break;
default :
return '';
}
}
//임시 번호를 생성하는 함수
function get_unique_code($prefix = ""){
$prefix = $prefix ? $prefix : "mk_";
return $prefix.mt_rand(10000, 99999).'_'.mt_rand(10000, 99999);
}
function get_unique_file($file){
$ext =get_extension($file);
$code= get_unique_code();
return $code.'.'.$ext;
}
//flag는 리눅스 인지, 윈도우인지, 리눅스의 경우 false, 윈도우의 경우 true
function fsockopen_func($url) {
$url_arr = parse_url($url);
$request = $url_arr['host'];
$get_value = $url_arr['path'].'?'.$url_arr['query'];
$fp = fsockopen($request, 80, $errno, $errstr, 3);
if (!$fp) {
return false;
} else {
$out = "GET $get_value HTTP/1.1\r\n";
$out .= "Host: $request\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$content .= fgets($fp, 128);
}
fclose($fp);
$content_arr = explode("\r\n\r\n", $content);
if($content_arr[1] ==false)
return '';
else
return $content_arr[1];
}
}
//잡코리아를 파싱하는 경우
function fsockopen_func_jobkorea($url, $flag= true) {
$url_arr = parse_url($url);
$request = $url_arr['host'];
$get_value = $url_arr['path'].'?'.$url_arr['query'];
$fp = @fsockopen($request, 80, $errno, $errstr, 5);
if (!$fp) {
return '';
} else {
$out = "GET $get_value HTTP/1.1\r\n";
$out .= "Host: $request\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$content .= fgets($fp, 128);
}
fclose($fp);
if(preg_match("/HTTP\/1\.1 200/", $content)==false)
return '';
//echo "done";
$content_arr = explode("\r\n", $content);
return $content_arr;
}
}
//알바몬을 파싱하는 경우
function fsockopen_func_albamon($url, $flag= true) {
$url_arr = parse_url($url);
$request = $url_arr['host'];
$get_value = $url_arr['path'].'?'.$url_arr['query'];
$fp = @fsockopen($request, 80, $errno, $errstr, 5);
if (!$fp) {
return false;
} else {
$out = "GET $get_value HTTP/1.1\r\n";
$out .= "Host: $request\r\n";
$out.= "User-Agent: {$_SERVER['HTTP_USER_AGENT']}\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
$content .= fgets($fp, 128);
}
fclose($fp);
if(preg_match("/HTTP\/1\.1 200/", $content)==false)
return '';
$content_arr = explode("<?xml", $content);
return $content_arr[1];
}
}
?><div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:16:08 PHP & HTML에서 이동 됨]</div>
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7430 |
|
11년 전 | 4948 | |
| 7429 | 11년 전 | 1782 | ||
| 7428 |
멋진남자임
|
11년 전 | 1175 | |
| 7427 |
sdflksdj2
|
11년 전 | 836 | |
| 7426 | 11년 전 | 1371 | ||
| 7425 | 11년 전 | 1395 | ||
| 7424 | 11년 전 | 1059 | ||
| 7423 |
SeungYeon
|
11년 전 | 569 | |
| 7422 | 11년 전 | 816 | ||
| 7421 |
sdflksdj2
|
11년 전 | 695 | |
| 7420 | 11년 전 | 976 | ||
| 7419 |
|
11년 전 | 1411 | |
| 7418 |
멋진남자임
|
11년 전 | 1447 | |
| 7417 | 11년 전 | 615 | ||
| 7416 |
senseme
|
11년 전 | 1242 | |
| 7415 | 11년 전 | 971 | ||
| 7414 | 11년 전 | 719 | ||
| 7413 | 11년 전 | 4854 | ||
| 7412 | 11년 전 | 4410 | ||
| 7411 |
holla
|
11년 전 | 903 | |
| 7410 | 11년 전 | 4257 | ||
| 7409 | 11년 전 | 3930 | ||
| 7408 | 11년 전 | 4274 | ||
| 7407 | 11년 전 | 5098 | ||
| 7406 | 11년 전 | 4738 | ||
| 7405 | 11년 전 | 4307 | ||
| 7404 | 11년 전 | 767 | ||
| 7403 | 11년 전 | 5691 | ||
| 7402 | 11년 전 | 1529 | ||
| 7401 |
|
11년 전 | 983 | |
| 7400 | 11년 전 | 2979 | ||
| 7399 |
멋진남자임
|
11년 전 | 926 | |
| 7398 |
파랑새1597
|
11년 전 | 2718 | |
| 7397 | 11년 전 | 2281 | ||
| 7396 |
basketball
|
11년 전 | 1382 | |
| 7395 | 11년 전 | 1620 | ||
| 7394 | 11년 전 | 937 | ||
| 7393 | 11년 전 | 2078 | ||
| 7392 | 11년 전 | 856 | ||
| 7391 |
잘살아보자
|
11년 전 | 5373 | |
| 7390 |
잘살아보자
|
11년 전 | 2234 | |
| 7389 |
잘살아보자
|
11년 전 | 3324 | |
| 7388 |
파랑새1597
|
11년 전 | 933 | |
| 7387 | 11년 전 | 1109 | ||
| 7386 |
프리랜서퍼블리셔
|
11년 전 | 975 | |
| 7385 | 11년 전 | 1576 | ||
| 7384 |
울라라라우
|
11년 전 | 897 | |
| 7383 | 11년 전 | 1565 | ||
| 7382 |
잘살아보자
|
11년 전 | 4239 | |
| 7381 |
잘살아보자
|
11년 전 | 2009 | |
| 7380 |
잘살아보자
|
11년 전 | 1952 | |
| 7379 |
잘살아보자
|
11년 전 | 5914 | |
| 7378 |
senseme
|
11년 전 | 1910 | |
| 7377 |
잘살아보자
|
11년 전 | 2757 | |
| 7376 | 11년 전 | 2423 | ||
| 7375 |
잘살아보자
|
11년 전 | 1056 | |
| 7374 |
잘살아보자
|
11년 전 | 3169 | |
| 7373 |
잘살아보자
|
11년 전 | 2489 | |
| 7372 |
잘살아보자
|
11년 전 | 5834 | |
| 7371 |
잘살아보자
|
11년 전 | 3472 | |
| 7370 |
잘살아보자
|
11년 전 | 1917 | |
| 7369 |
잘살아보자
|
11년 전 | 2179 | |
| 7368 |
ksdhtm56
|
11년 전 | 576 | |
| 7367 | 11년 전 | 1444 | ||
| 7366 | 11년 전 | 941 | ||
| 7365 | 11년 전 | 3556 | ||
| 7364 |
잘살아보자
|
11년 전 | 1404 | |
| 7363 |
잘살아보자
|
11년 전 | 1384 | |
| 7362 |
잘살아보자
|
11년 전 | 1521 | |
| 7361 | 11년 전 | 3609 | ||
| 7360 | 11년 전 | 3570 | ||
| 7359 | 11년 전 | 3391 | ||
| 7358 |
멋진남자임
|
11년 전 | 1044 | |
| 7357 | 11년 전 | 3423 | ||
| 7356 | 11년 전 | 2609 | ||
| 7355 | 11년 전 | 3204 | ||
| 7354 |
파랑새1597
|
11년 전 | 658 | |
| 7353 |
잘살아보자
|
11년 전 | 2433 | |
| 7352 |
잘살아보자
|
11년 전 | 2427 | |
| 7351 |
잘살아보자
|
11년 전 | 2485 | |
| 7350 |
잘살아보자
|
11년 전 | 1484 | |
| 7349 |
잘살아보자
|
11년 전 | 1974 | |
| 7348 |
잘살아보자
|
11년 전 | 1293 | |
| 7347 |
잘살아보자
|
11년 전 | 1087 | |
| 7346 |
멋진남자임
|
11년 전 | 1654 | |
| 7345 | 11년 전 | 1006 | ||
| 7344 | 11년 전 | 3882 | ||
| 7343 | 11년 전 | 3668 | ||
| 7342 | 11년 전 | 1296 | ||
| 7341 | 11년 전 | 2534 | ||
| 7340 |
|
11년 전 | 945 | |
| 7339 | 11년 전 | 1741 | ||
| 7338 | 11년 전 | 3358 | ||
| 7337 | 11년 전 | 3672 | ||
| 7336 | 11년 전 | 4611 | ||
| 7335 | 11년 전 | 985 | ||
| 7334 | 11년 전 | 1544 | ||
| 7333 | 11년 전 | 2951 | ||
| 7332 |
|
11년 전 | 1123 | |
| 7331 |
KeePin뽁이
|
11년 전 | 1110 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기