투표후 작업하다 막힌1인입니다.

투표후 작업하다 막힌1인입니다.

QA

투표후 작업하다 막힌1인입니다.

본문

몇가지 값과 파일을 올리는 소스인데요. 잘안데네요. 

 
<body id="pop">
<form method="post" name="board_form" action="teacher_exe.php" enctype="Multipart/form-data" style="border:0; margin:0;">
<input type="hidden" name="mode" value="write">
	<div id="popBody" style="width:364px;">
		<h1><img src="./img/member/popt_teach.gif" alt=""></h1>
		<div class="pb_30 ac"><img src="./img/member/teach_text.gif" alt="" width="331" height="43"><br><br>
	      <a href="resume.doc"><img src="./img/member/teach_btn.gif" width="168" height="47" border="0"></a></div>
		<div class="popCont">
			<div id="popCont_box">
				<table width="300" border="0" cellspacing="0" cellpadding="0">
				  <tr>
					<td colspan="2"><img src="./img/bbs/bul_05.gif" alt="" align="absmiddle"> <img src="./img/member/teach_ptitle.gif" alt="" align="absmiddle"></td>
				  </tr>
				  <tr>
					<td width="50" height="30">성명</td>
					<td width="250"><input type="text" size="10" name="name" /></td>
				  </tr>
				  <tr>
					<td height="30">이력서</p>
					<td><input type="file" size="10" name="filename" ></td>
				  </tr>
				</table>
			</div>
		</div>
 
		<div class="pt_10 ac"><a href="Javascript:check();"><img src="./img/bbs/btn_enter.gif" alt=""></a></div>
 
	</div>
</form>
</body>


아래는 exe 파일입니다. 
 
<?
include_once('./_common.php');
 
$indate = date("yyyy-mm-dd");    
 
if ($mode == "write") {
	if ($file1_size > 0 ) {
		$filepath = "./upload/teacher_support/".$filename;
		if (file_exists($filepath)) {
			echo "<script>alert('같은 이름의 파일이 존재합니다. 파일명 변경후 다시 등록바랍니다.');history.back();</script>";
			exit;
		}
		copy($filename, $filepath);
		$indate = time();
 
		$sql = "INSERT INTO ".TEACHER." (name, filename, indate) VALUES ('$name', '$filepath', '$indate')";
		mysql_query($sql);
 
		echo "<script>
			alert('이력서가 접수되었습니다.');
			window.close();
			</script>";
	}
}
?>
 

디비구조는 다음과 같습니다

 

idx    int(11) 자동증가 

name    varchar(20)

filename      varchar(20)

indate        date 


이 질문에 댓글 쓰기 :

답변 3

1. $file1_size 이건 어디서 왔나요?

2. 파일 업로드하는 부분은 어딨는지요?

3. 업로드도 안 했는데 파일이 있는지 없는지 체크를 하는 것도 그렇구요.

4. TEACHER 이건 상수 같은데 어디에 있나요?

5. indate 칼럼 type이 date로 되어 있는데 실제 값 넣는 부분에서는 unix time이네요.

 

답변을 작성하시기 전에 로그인 해주세요.
전체 123,592 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT