업로드 파일 처리 루틴
author 관리자 date 2003-11-17 hit 180 HIT
업로드되는 파일명의 변수가 $poster 일 경우의 업로드 파일 처리..

// 업로드 파일 처리
if($poster != "none") {
// 파일명 체크
$poster_name=$HTTP_POST_FILES['poster']['name'];
// 파일타입 체크
$poster_type=$HTTP_POST_FILES['poster']['type'];
// 파일사이즈 체크
$poster_size=$HTTP_POST_FILES['poster']['size'];
// 임시 파일명 체크
$poster_tmp_name=$HTTP_POST_FILES['poster']['tmp_name'];


// 업로드 화일명 중복 체크
$chk_poster=mysql_fetch_array(mysql_query("select count(*) from $movie_table where poster='$poster_name'",$connect));

if($chk_poster[0]>0) {
echo"<script>alert(\"$poster_name 이란 파일명은 이미 등록되어 있습니다.\");</script>
<script>history.go(-1);</script>";
exit;
}

// 업로드 화일을 디렉토리로 이동
if(!move_uploaded_file($poster, 'data/'.$id.'/'.$poster_name)){
echo"<script>alert(\"업로드 자료의 저장에 실패하였습니다.\");</script>
<script>history.go(-1);</script>";
exit;
}
}

// 이름 중복 자료 체크
$chk_subject=mysql_fetch_array(mysql_query("select count(*) from $movie_table where subject='$subject'",$connect));
if($chk_subject[0]>0) {
echo"<script>alert(\"$subject 영화가 이미 등록되어 있습니다.\");</script>
<script>history.go(-1);</script>";
exit;
}

// 미지정 등록번호(------)가 아닌 경우 등록번호 중복 자료 체크
if($case_num != "------") {
$chk_case_num=mysql_fetch_array(mysql_query("select count(*) from $movie_table where case_num='$case_num'",$connect));
if($chk_case_num[0]>0) {
echo"<script>alert(\"등록번호 $case_num 은 이미 등록되어 있습니다.\");</script>
<script>history.go(-1);</script>";
exit;
}
}
목록보기
        X  
31  PHP7 클래스 선언 방법  2021-11-03 397
30  PHP7 배열 선언 코드  2021-11-03 629
29  PHP 코드를 최적화하는 40가지 팁 (번역)  2009-12-23 590
28  if , else 조건문 코드 줄이기 (?:)  2009-12-23 438
27  간단한 이메일 보내기 클래스  2008-03-05 558
26  PHP 로 TTF 파일을 웹폰트로 만들기  2006-05-28 565
25  업로드 이미지 사이즈 처리  2006-05-23 481
24  glob -- Find pathnames matching a pattern  2006-05-18 342
23  Thumbnail Image (GD 처리)  2006-05-15 397
22  첨부 이미지(스샷) 사이즈 조정  2006-05-15 276
21  PHP Fuction 검색 창 소스  2006-04-11 359
20  이미지 파일의 가로, 세로 픽셀 알아내기  2006-04-11 319
19  테스트용 변수 출력 소스  2006-04-06 306
18  SMS 발송 - 명단 입력 스크립트  2005-09-16 293
17  리눅스 apache, php 에서 mssql connecting 하기  2005-06-07 494
16  php를 이용하여 서버 백업 프로그램 짜기  2004-05-04 460
15  베이비 헤로스 이벤트 소스  2004-04-28 277
14  세션 생성..  2004-04-21 343
13  제로보드 view.php 분석  2004-04-07 305
12  다중 게시판 검색  2004-03-25 1322
1 2