พอดีว่ามันเซฟชื่อลงฐานข้อมูล แต่มันไม่ก๊อบรุปไปลงที่โฟลเดอร์ที่กำหนดไว้ให้ค่ะ ช่วยด้วยค่ะ
$title_new=$_POST['title_new'];
$detail_new=$_POST['detail_new'];
$type_new=$_POST['type_new'];
$photo=$_FILES['photo']['tmp_name'];
$photo_name=$_FILES['photo']['name'];
$photo_size=$_FILES['photo']['size'];
$photo_type=$_FILES['photo']['type'];
$date_today=date("Y-m_d");
$time_today=date("H:i:s");
if($title_new=="" or $detail_new=="" or $type_new=="0"){
echo "<h2>กรุณากรอกข้อมูลให้ครบ</h2>";
exit();
}
include "connection.inc.php";
$sql=" insert into tb_new
values(null,'$title_new','$detail_new','$type_new','','$date_today','$time_today')";
mysql_db_query("$dbname",$sql);
$ext=strtolower(end(explode('.',$photo_name)));
if($ext=="jpg" or $ext=="jpeg" or $ext=="png" or $ext=="gif"){
$sql="select max(id_new) from tb_new";
$result=mysql_db_query($dbname,$sql);
$r=mysql_fetch_array($result);
$id_max=$r[0];
$filename=$id_max.".".$ext;
copy($photo,"photo\$filename");
$sql="update tb_new set photo_new='$filename' where id_new='$id_max' ";
mysql_db_query($dbname,$sql);
}
echo mysql_error();
echo "<h3>เพิ่มข้อมูลเรียบร้อยแล้วค่ะ</h3>";
echo"[<a href=new_main.php>กลับหน้าหลัก</a>]";
mysql_close();
?>
ภาษาไทย สำหรับ phpBB เวอร์ชั่นล่าุด คือ 3.2.2
มาแล้วโหลดได้เลย
มาแล้วโหลดได้เลย
ช่วยดูโค้ดอัพโหลดนี้ให้ทีค่ะ
Moderator: phpbb, mindphp, ผู้ดูแลกระดาน
ใช้ Server อะไร ครับ
แล้ว มี error อะไร หรือเปล่า
form รับค่ามาจากไหน
แล้ว มี error อะไร หรือเปล่า
form รับค่ามาจากไหน
สร้างไฟล์ pdf online
ท่องเที่ยว http://www.thailandhotelforums.com/" onclick="window.open(this.href);return false;
สอน php http://www.mindphp.com/" onclick="window.open(this.href);return false;
ท่องเที่ยว http://www.thailandhotelforums.com/" onclick="window.open(this.href);return false;
สอน php http://www.mindphp.com/" onclick="window.open(this.href);return false;
copy($photo,"photo\$filename");
ระบบ ไฟล์ จะเป็น copy($photo,"photo/$filename");
หรือ ถ้าจะเขียน ให้ดูดีหน่อยก็ แยกระหว่างตัวแปลกับค่าออกซักหน่อยก็ดีครับ
เป็น
copy($photo,"photo/" . $filename);
ระบบ ไฟล์ จะเป็น copy($photo,"photo/$filename");
หรือ ถ้าจะเขียน ให้ดูดีหน่อยก็ แยกระหว่างตัวแปลกับค่าออกซักหน่อยก็ดีครับ
เป็น
copy($photo,"photo/" . $filename);
สร้างไฟล์ pdf online
ท่องเที่ยว http://www.thailandhotelforums.com/" onclick="window.open(this.href);return false;
สอน php http://www.mindphp.com/" onclick="window.open(this.href);return false;
ท่องเที่ยว http://www.thailandhotelforums.com/" onclick="window.open(this.href);return false;
สอน php http://www.mindphp.com/" onclick="window.open(this.href);return false;
ผู้ใช้งานขณะนี้
กำลังดูบอร์ดนี้: 239 และ บุคคลทั่วไป 0 ท่าน