|
|
|
ใช้้ move_upload 2 ครั้งไปคนละที่ทำไงครับ ผมงงครับ |
|
|
|
|
|
|
|
Code (PHP)
<?
$fileName = "thumb-".$_FILES["filAlbumShot"]["name"];
$fileName = "slider-".$_FILES["filslider"]["name"];
$txtname = $_POST['txtAlbumName'];
$txttopic = $_POST['txtInfor'];
if(move_uploaded_file($_FILES["filAlbumShot"]["tmp_name"],"resource/thumbnail/".$fileName));
if(move_uploaded_file($_FILES["filslider"]["tmp_name"],"resource/slider/".$fileName))
}
echo "Copy/Upload Complete<br>";
$conn = "INSERT INTO tb_gallery ";
$conn .="(`GalleryID` ,`Name` ,`Topic` ,`Thumbnail` ,`Slider` ) VALUES (NULL ,'".$txtname."' ,'".$txttopic."','".$fileName."','".$filslider."')";
$objQuery = mysql_query($conn);
}
?>
Tag : PHP, MySQL, CakePHP
|
|
|
|
|
|
Date :
2013-07-10 18:19:15 |
By :
yoko |
View :
673 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ได้ซะงั้น
Code (PHP)
$fileName = "thumb-".$_FILES["filAlbumShot"]["name"];
$filslider = "slider-".$_FILES["filslider"]["name"];
$txtname = $_POST['txtAlbumName'];
$txttopic = $_POST['txtInfor'];
if(move_uploaded_file($_FILES["filAlbumShot"]["tmp_name"],"resource/thumbnail/".$fileName));
{
if(move_uploaded_file($_FILES["filslider"]["tmp_name"],"resource/slider/".$fileName));
{
}
echo "Copy/Upload Complete<br>";
$conn = "INSERT INTO tb_gallery ";
$conn .="(`GalleryID` ,`Name` ,`Topic` ,`Thumbnail` ,`Slider` ) VALUES (NULL ,'".$txtname."' ,'".$txttopic."','".$fileName."','".$filslider."')";
$objQuery = mysql_query($conn);
}
?>
|
|
|
|
|
Date :
2013-07-10 18:24:15 |
By :
yoko |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|