|
 |
|
Error : Warning: fread(): supplied argument is not a valid stream resource อัพรูปลงฐานข้อมูลไม่ได้ |
|
 |
|
|
 |
 |
|
มันแจ้ง Error สองบรรทัดนี้คะ
Warning: fread(): supplied argument is not a valid stream resource in C:\AppServ\www\Wab\inform_add.php on line 76
Warning: fclose(): supplied argument is not a valid stream resource in C:\AppServ\www\Wab\inform_add.php on line 78
ช่วยหน่อยนะคะ
พรุ่งนี้สอบจบโปรเจคแล้ว ดันมาติดอันนี้อีก
Code (PHP)
$img_data = "";
if($_FILES['file']['error'] == 0) {
$file = $_FILES['file']['tmp_name'];
$name=$_FILES['file']['name'];
$size=$_FILES['file']['size'];
$type=$_FILES['file']['type'];
$f = fopen($file, "r");
$img_data = fread($f, filesize($file));<<<<<<<<<<<<<<<<<<<<<<บรรทัดนี้
$img_data = addslashes($img_data);
fclose($f);<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<และบรรทัดนี้
//echo $type;
}
if (($type== "image/jpg") || ($type== "image/pjpeg") || ($type== "image/png") || ($type== "image/gif") && ($size<700000)) {
$str="insert into inform values('' , '$cust_id' , '$name' , '$email' , '$tel' , '$bank' , '$money' , '$date' , '$time' , '$name' )";
copy($file,"imgs/$name");
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2011-02-20 16:56:05 |
By :
rmutl |
View :
1133 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$f = fopen($_FILES['file']['tmp_name'], "r");
ใช้ชื่อตัวแปรซ้ำกันน่ะครับ เปลี่ยนชื่อก็ดีน่ะครับ
$file กับ $_FILES['file'] ในการณีที่ใช้ register_global = On
|
 |
 |
 |
 |
Date :
2011-02-21 18:42:30 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|