หัวข้อ: $_FILES error เริ่มหัวข้อโดย: affsom ที่ 31 มกราคม 2016, 18:34:10 public function putPostReply($thread,$id,$name,$subject,$message,$_FILES = NULL) {
$query = $this->db->query("INSERT INTO " . DB_PREFIX . "forum_posts (id,thread,root,parent,name,customer_id,subject,content,time,ip,replies) VALUES (NULL," . $thread . "," . $id . "," . $id . ",'" . addslashes($name) . "','" . (int)$this->customer->getId() . "','" . addslashes($subject) . "','" . addslashes($message) . "',UNIX_TIMESTAMP(),'" . $_SERVER['REMOTE_ADDR'] . "',0)"); $idreply = $this->db->getLastId(); if($_FILES != NULL){ $x = 0; while(isset($_FILES['files']['name'][$x])){ $target_path = DIR_IMAGE . "data/image/posts/"; $newfilename = $idreply . '--' . rand(10000000000,99999999999) . time() . '--' . basename($_FILES['files']['name'][$x]); $target_path = $target_path . $newfilename; if(move_uploaded_file($_FILES['files']['tmp_name'][$x], $target_path)) { } $x++; } } } ==================== Fatal error: Cannot re-assign auto-global variable _FILES มันแจ้ง error ที่ line = public function putPostReply($thread,$id,$name,$subject,$message,$_FILES = NULL) { แก้ยังไงครับ php 5.5 error แต่เปลี่ยนเป็น 5.3 ไม่error ==================== :wanwan023: :wanwan023: :wanwan017: หัวข้อ: Re: $_FILES error เริ่มหัวข้อโดย: xvlnw.com ที่ 31 มกราคม 2016, 18:59:20 สร้างตัวแปรชื่อใหม่ครับ
หัวข้อ: Re: $_FILES error เริ่มหัวข้อโดย: affsom ที่ 31 มกราคม 2016, 19:09:01 สร้างตัวแปรชื่อใหม่ครับ 5555 ลืม $_FILES เป็น grobal ใส่ใน function ไม่ได้ :wanwan004: :wanwan017: :wanwan017: |