<?php require_once("../config.inc/connect.php"); if (!empty($cos_name)&& !empty($cos_area)&& !empty($cos_new)){ $file_image = $_FILES["file_image"]['tmp_name'];//บันทึก ตำแหน่งเก็บไฟล์ชั่วคราว ลงตัวแปร $file_name = $_FILES["file_image"]["name"];//บันทึก ชื่อไฟล์ ลงตัวแปร if($file_image){ $tpic=time(); $fileArray = explode(".",$file_name); $file_name = "c_".$tpic.".".$fileArray[1]; if(copy($file_image,"../picture/".$file_name)){ $new_file=$file_name; }else{ print "<a href=# onclick='history.back()'>ไม่สามารถ อัพโหลดไฟลฺเอกสารได้</a>"; } }else{$new_file="";} $query="insert into cous( cos_name,cos_area,cos_new,cos_detail ) values ( '$cos_name','$cos_area','$cos_new','$new_file')"; echo $query; if(mysql_query($query)){ print"<script language='JavaScript'>"; print"alert('เพิ่มข้อมูลเรียบร้อยแล้วค่ะ');"; print"</script>"; print "<meta http-equiv='refresh' content='0;url=course_show.php' />"; }else{ print "<a href=# onclick='history.back()'>ไม่สามารถ เพิ่มข้อมูล</a>"; } }else{ print "<a href=# onclick='history.back()'>กรุณากรอกข้อมูลให้ครบ ด้วยค่ะ</a>"; } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง