|
|
|
ช่วยดูให้หน่อยครับ Add รูปภาพ แล้วทำไมมันไม่ได้อ่ะครับ ช่วยหน่อยนะครับ |
|
|
|
|
|
|
|
อัพโหลด
Code (PHP)
<?php
include"chkbrowser.php";
$name=$_POST[name];
$title=$_POST[title];
$fileupload=$_FILES['fileupload']['tmp_name'];
$fileupload_name=$_FILES['fileupload']['name'];
$fileupload_size=$_FILES['fileupload']['size'];
$fileupload_type=$_FILES['fileupload']['type'];
$sql="insert into slideshow values('','','$title')";
$result=mysql_db_query($dbname,$sql);
if ($fileupload <> '') {
$array_last=explode(".",$fileupload_name);
$c=count($array_last)-1;
$lastname=strtolower($array_last[$c]) ;
if ($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg" or $lastname=="png") {
$sql2="select max(id_slideshow) from slideshow ";
$result2=mysql_db_query($dbname,$sql2);
$row=mysql_fetch_row($result2);
$photoname=$name.".".$lastname;
copy($fileupload,"images/slideshow/".$photoname);
$sql3="update slideshow set name_slideshow='$photoname' where id_slideshow ='$row[0]' ";
$result3=mysql_db_query($dbname,$sql3);
}
unlink($fileupload);
} else {
$sql4="select max(id_slideshow) from slideshow ";
$result4=mysql_db_query($dbname,$sql4);
$row2=mysql_fetch_row($result4);
$sql5="delete from slideshow where id_slideshow='$row2[0]' ";
$result5=mysql_db_query($dbname,$sql5);
echo "<script>alert(' No Picture ');</script>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0.1;URL=admin_slider.php\">"; exit();
}
if ($result&$result3) {
echo "<script>alert(' Upload Finish ');</script>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0.1;URL=admin_slider.php\">"; exit();
} else {
$sql4="select max(id_slideshow) from slideshow ";
$result4=mysql_db_query($dbname,$sql4);
$row2=mysql_fetch_row($result4);
$sql5="delete from slideshow where id_slideshow='$row2[0]' ";
$result5=mysql_db_query($dbname,$sql5);
echo "<script>alert(' Error Picture over 512 K. ');</script>";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0.1;URL=admin_slider.php\">"; exit();
}
mysql_close();
?>
|
|
|
|
|
Date :
2013-01-21 15:45:06 |
By :
konhuafu.it |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เหมือนมัน ไปเงื่อนไข
$fileupload มันเป็นค่าว่างอ่ะครับ มันเลยไป else
|
|
|
|
|
Date :
2013-01-21 15:46:46 |
By :
konhuafu.it |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลืมใส่ <form enctype="multipart/form-data"> รึเปล่า ดูดีดีครับ
|
|
|
|
|
Date :
2013-01-21 15:49:13 |
By :
Ex-[S]i[L]e[N]t |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ใช่จริงๆ ด้วย ฮ่าๆๆๆๆ ขอบคุณครับ ตายน้ำตื้นแท้ๆ ขอบคุณครับ คุณ Ex-[S]i[L]e[N]t
|
|
|
|
|
Date :
2013-01-21 15:51:43 |
By :
konhuafu.it |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|