메뉴 건너뛰기

프로그램언어

조회 수 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 06Mar
    by
    2017/03/06 Views 17474 

    엑셀(*.xls) 화일을 PHP에서 읽기

  2. No Image 23Dec
    by
    2016/12/23 Views 17328 

    시간관련함수

  3. 게시판 페이징 기법과 개념

  4. PHP에서 Excel 파일을 만들 수 있는 PHPExcel

  5. No Image 06Mar
    by
    2017/03/06 Views 17109 

    지엠 웹에디터 v1.1 (저작권표시없음)|

  6. No Image 07Mar
    by
    2017/03/07 Views 17080 

    www가 붙은 도메인과 안붙은 같은 도메인, 로그인 세션 유지

  7. No Image 06Mar
    by
    2017/03/06 Views 17063 

    PHP 만년달력 소스

  8. No Image 07Mar
    by
    2017/03/07 Views 17004 

    php 내장함수

  9. No Image 06Mar
    by
    2017/03/06 Views 16707 

    PHP 날짜, 시간 관련 함수. date(), mktime()

  10. No Image 06Mar
    by
    2017/03/06 Views 16610 

    PHP의 유동변수!? - $a1 ~ $a2 같은 형식의 변수를 반복문 돌릴때...

  11. No Image 06Mar
    by
    2017/03/06 Views 15769 

    php로 db 컨트롤 1

  12. No Image 06Mar
    by
    2017/03/06 Views 15580 

    php 문자열관련 함수

  13. No Image 06Mar
    by
    2017/03/06 Views 15508 

    메일주소의 골뱅이를 그림처리하기

  14. base64 인코딩/디코딩 함수의 특징

  15. PHP 네이버블로그 원격 글쓰기 API 소스

  16. No Image 09Feb
    by
    2018/02/09 Views 10626 

    PHP에서 암호화 encrypt 복호화 decrypt 해서 값을 넘기기

  17. No Image 04Jul
    by
    2018/07/04 Views 8456 

    AJAX를 활용하여 JSON 댓글 처리하기 (PHP)

  18. No Image 28Mar
    by
    2018/03/28 Views 8154 

    MySQL(MariaDB) 테이블 만들기

  19. [이클립스]PHP 개발환경 만들기

  20. No Image 24Jul
    by 조쉬
    2018/07/24 Views 7322 

    헤더이용 다운로드 받을시 바로열기부분 소스

Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 17 Next
/ 17

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

© k2s0o1d4e0s2i1g5n. All Rights Reserved