|
 |
|
จาก code ถ้าผมอยากดึกรูปออกมาแสดงบนตาราง เรียงกันทีละรูปพร้อมแสดงชื่อรูป แนะนำทีครับ |
|
 |
|
|
 |
 |
|
อยากเอารูปที resize แล้วมาแสดงบนตารางเรียงกันลงไปทีละรูปพร้อมทั้งแสดงลายละเอียดรูปด้วย แนะนำทีครับ ขอบคุณครับ  
<?
if(trim($_FILES["fileUpload"]["tmp_name"]) != "")
{
$images = $_FILES["fileUpload"]["tmp_name"];
$new_images = "Thumbnails_".$_FILES["fileUpload"]["name"];
copy($_FILES["fileUpload"]["tmp_name"],"MyResize/".$_FILES["fileUpload"]["name"]);
$width=100; //*** Fix Width & Heigh (Autu caculate) ***//
$size=GetimageSize($images);
$height=round($width*$size[1]/$size[0]);
$images_orig = ImageCreateFromJPEG($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
ImageJPEG($images_fin,"MyResize/".$new_images);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
}
?>
<img src="<?="MyResize/".$new_images;?>">
<?
if(trim($_FILES["fileUpload"]["tmp_name"]) != "")
{
$images = $_FILES["fileUpload"]["tmp_name"];
$new_images = "Thumbnails_".$_FILES["fileUpload"]["name"];
copy($_FILES["fileUpload"]["tmp_name"],"MyResize/".$_FILES["fileUpload"]["name"]);
$width=100; //*** Fix Width & Heigh (Autu caculate) ***//
$size=GetimageSize($images);
$height=round($width*$size[1]/$size[0]);
$images_orig = ImageCreateFromJPEG($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
ImageJPEG($images_fin,"MyResize/".$new_images);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
}
?>
<img src="<?="MyResize/".$new_images;?>">
<?
$name_pd=$_POST[name_pd];
if ($name_pd=="") {
echo"<h3><a href='addproduct.php'>
กรุณากรอกข้อมูลด้วย</a></h3>";
}
include "connect.php";
$sql="insert into product
values('','$name_pd')";
$result=mysql_db_query($dbname,$sql);
if($result) {
echo "<h3>ชื่อภาพและรายละเอียด $name_pd<p></h3>";
echo "<h3>ข้อมูลถูกบันทึกเรียบร้อยแล้ว</h3>";
echo "<A HREF='addproduct.php'>กลับ</A>";
} else {
echo "<h3>ไม่สามารถบันทึกข้อมูลได้</h3>";
echo "<A HREF='addproduct.php'>กลับ</A>";
}
mysql_close();
?>
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2010-07-22 01:55:53 |
By :
midobun |
View :
936 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2010-07-22 07:50:25 |
By :
midobun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|