몇가지 값과 파일을 올리는 소스인데요. 잘안데네요.
Copy
<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 파일입니다.
Copy
<?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개
채택된 답변
+20 포인트
9년 전
1. $file1_size 이건 어디서 왔나요?
2. 파일 업로드하는 부분은 어딨는지요?
3. 업로드도 안 했는데 파일이 있는지 없는지 체크를 하는 것도 그렇구요.
4. TEACHER 이건 상수 같은데 어디에 있나요?
5. indate 칼럼 type이 date로 되어 있는데 실제 값 넣는 부분에서는 unix time이네요.
9년 전
디비로 값이 안올라가네요..ㅠ
9년 전
뭐가 어떻게 안되는 건지 설명해주세요.
답변을 작성하려면 로그인이 필요합니다.