|
 |
|
ช่วยดูโค๊ดให้หน่อยครับการอัพโหลดภาพไปยัง Server จริง ทำไม่ได้ แต่ server จำลองในเครื่องโหลดได้ครับ |
|
 |
|
|
 |
 |
|

Code (PHP)
if ($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg")
{
$set_photo=explode(".",$photo_name);
$pname="item_".$_POST['itemno'];
$plname=$set_photo[1];
$photoname=$pname.".".$plname;
$photo1=$photoname;
copy($photo,"../images/item/".$photoname);
$sql_add="insert into tbproduct (itemid,itemname,ref_typeid,ref_catid,unitprice,status,detail,picture) values ('$itemid','$tname','$typeid','$catid','$price','1','$detail','$photoname');";
$result_add=mysql_query($sql_add);
echo "บันทึกข้อมูลเรียบร้อยแล้ว (รูปภาพ)";
echo"<meta http-equiv='refresh' content='2;url=addproduct.php'>";
}
else
{
echo "<h3><CENTER>ERROR : ไม่สามารถบันทึกไฟล์รูปภาพได้ (ต้องเป็น .jpg, .gif เท่านั้น) <br> กรุณารอสักครู่ !!</CENTER></h3>";
echo"<meta http-equiv='refresh' content='5;url=addproduct.php'>";
}
unlink($photo);
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2011-09-22 06:55:03 |
By :
Sira |
View :
685 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
|
|

|
Load balance : Server 04
|