메뉴 건너뛰기

프로그램언어

조회 수 7322 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

<?
include "../inc/global.inc";

$sql = "select upfile,upfile2,upfile3,upfile_name,upfile2_name,upfile3_name from ez_bbs where code = '$code' and idx = '$idx'";
$result = mysql_query($sql) or error(mysql_error());
$row = mysql_fetch_object($result);

if($no == ""){
 $file = "./upfile/$code/$row->upfile"; $filename = $row->upfile_name;
}else if($no == "2"){
 $file = "./upfile/$code/$row->upfile2"; $filename = $row->upfile2_name;
}else if($no == "3"){
 $file = "./upfile/$code/$row->upfile3"; $filename = $row->upfile3_name;
}

if(file_exists($file)) {
  
   if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
       header("Content-Type: doesn/matter");
       header("Content-Disposition: filename=$filename");
       header("Content-Transfer-Encoding: binary");
       header("Pragma: no-cache");
       header("Expires: 0");
   }else{
       Header("Content-type: file/unknown");
       Header("Cache-Control: cache, must-revalidate");
       Header("Content-Disposition: attachment; filename=$filename");
       Header("Content-Description: PHP3 Generated Data");
       header("Pragma: no-cache");
       header("Expires: 0");
   }
  
   if(is_file("$file")){
       $fp = fopen("$file","r");
       if(!fpassthru($fp)) {
           fclose($fp);
       }
   }
 
}else{
   echo "<script>alert('첨부파일이 존재하지 않습니다.');history.go(-1);</script>";
}

?>



  1. No Image 07Mar
    by
    2017/03/07 Views 40424 

    리다이렉션(페이지 이동)의 3가지 방법, location.href

  2. No Image 19Feb
    by
    2017/02/19 Views 35895 

    [PHP] 게시판 글쓰기와 이미지 파일 DB 저장 및 불러오기 예제

  3. No Image 21Sep
    by
    2016/09/21 Views 33237 

    $_SERVER 환경변수

  4. No Image 27Feb
    by
    2014/02/27 Views 32783 

    PHP에서 PDF파일 생성하기

  5. No Image 27Feb
    by
    2014/02/27 Views 31636 

    PHP에서 자바스크립트 값 가져오기

  6. No Image 12Apr
    by
    2014/04/12 Views 30543 

    htmlentities <-> html_entity_decode (엔티티

  7. No Image 27Feb
    by
    2014/02/27 Views 30504 

    Class를 이용한 DB Connection 소스 (Oracle, MyS

  8. No Image 27Feb
    by
    2014/02/27 Views 30280 

    무조건 알아야 할 PHP 속도 테스트 14 가지

  9. No Image 27Feb
    by
    2014/02/27 Views 30257 

    PHP로 Excel 파일 만들기...

  10. No Image 27Feb
    by
    2014/02/27 Views 29814 

    Text를 GD 이미지로 뿌리기

  11. No Image 07Mar
    by
    2017/03/07 Views 29790 

    php 엑셀 다운로드 구현

  12. No Image 27Feb
    by
    2014/02/27 Views 29446 

    글내용 이미지 리사이징

  13. No Image 27Feb
    by
    2014/02/27 Views 29228 

    쿠키변수받기

  14. No Image 27Feb
    by
    2014/02/27 Views 29201 

    Record Drag/Drop Position

  15. No Image 06Mar
    by
    2017/03/06 Views 28549 

    간단한 PHP 파일 업로드, 다운로드 구현

  16. No Image 27Feb
    by
    2014/02/27 Views 28332 

    DB상의 많은 파일을 한꺼번에 다운받기

  17. No Image 27Feb
    by
    2014/02/27 Views 26945 

    GD를 이용한 스팸성 게시물 차단을 위한 보안 단어 입력 예제

  18. No Image 27Feb
    by
    2014/02/27 Views 26733 

    주간날짜 뽑아오기

  19. No Image 14Apr
    by
    2015/04/14 Views 26626 

    전화번호에 하이픈(-) 넣기

  20. No Image 14Apr
    by
    2015/04/14 Views 26590 

    PHP 변수전달 GET, POST

Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17

하단 정보를 입력할 수 있습니다

© k2s0o1d4e0s2i1g5n. All Rights Reserved