|
 |
|
ช่วยดู CODE ให้หน่อย คือ ติดปัญหาที่ อัพโหลดไฟล์ไม่เข้า ใน Database เเต่ ไฟล์ มันเข้าไปใน forder |
|
 |
|
|
 |
 |
|
ช่วยดู CODE ให้หน่อย คือ ติดปัญหาที่ อัพโหลดไฟล์ไม่เข้า ใน Database เเต่ ไฟล์ มันเข้าไปใน foder ที่ตั้งไว้
<?
ob_start();
session_start();
include("../Includes/root.inc.php");
include("../Includes/config.inc.php");
include("class/func_class.class.php");
include("class/func_sql_queryuser.class.php");
if( $_GET[Systems] == "SaveData" && $_POST[CboTypeHomeWork] != "" && $_POST[CboTypeHomeWork] != "" && $_POST[TxtTittleHomework] != "" ){
if($_POST[hdnHomeworkId] == ""){
$DateTimeRegister = date("Y-m-d ");
$this <- Sql("INSERT INTO homework (TypeHomeworkId,Homework_title,Homework_file,DateTimeRegister) VALUES('".$_POST[CboTypeHomeWork]."','".$_POST[TxtTittleHomework]."','','".($DateTimeRegister)."')");
echo "<script language=\"javascript\">alert('บันทึกข้อมูลเป็นที่เรียบร้อยเเล้ว'); </script>";
}else{
$this <- Sql("UPDATE news SET Homework_title= '".$_POST[CboTypeFaculity]."', Homework_detail= '".$_POST[CboTypeHomeWork]."' WHERE News_Id='".$_POST[hdnHomeworkId]."'");
echo "<script language=\"javascript\">alert('บันทึกการแก้ไขข้อมูลเป็นที่เรียบร้อยเเล้ว'); </script>";
$file_upload = $_FILES['FileUpload']['tmp_name'];
$file_name = $_FILES['FileUpload']['name'];
$file_size = $_FILES['FileUpload']['size'];
$ext = substr("$file_name",-3);
$GenCode = random_password(14); // ดึงมาจาก Class Rundom Password
$_GET[Systems] == "ShowData";
$_GET[Homework_id] = $_POST[hdnHomeworkId];
}
}
$GenCode = random_password(14); // ดึงมาจาก Class Rundom Password
if($file_name != ""){// ตรวจสอบชื่อของไฟล์ ว่ามีชื่อหรือไม่
if($ext=='doc' || $ext=='pdf'|| $ext=='ptt' || $ext=='xls'){ //ตรวจสอบ Type File
$File = "pic_".$GenCode.".".$ext;
$dir = "../Upload_file/"; // Part ของ Folder ว่ามีหรือไม่
if(copy($file_upload ,$dir.$File)){
$this <- Sql("UPDATE study SET Homework_file= '$FileName' WHERE Homework_id='".$_POST[hdnHomeworkId]."'");
}
}
if($_GET[Systems] == "ShowData" && $_GET[Homework_id] != ""){
$sql_show = "SELECT * FROM homework WHERE Homework_id='".$_GET[Homework_id]."'";
$EditTypeHomeworkId = Resulte("$sql_show","TypeHomeworkId");
$EditHomework_title = Resulte("$sql_show","Homework_title");
$EditHomework_file = Resulte("$sql_show","Homework_file");
}
}
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2010-01-16 11:11:16 |
By :
JJJJ |
View :
768 |
Reply :
0 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 00
|