Tue 1 Apr 2008 20:54:23
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<form name="form1" enctype="multipart/form-data" method="post" action="">
<table width="900" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td width="216" valign="top"><div align="right">รูป : </div></td>
<td width="684"><input name="file" type="file" ></td>
</tr>
<tr>
<td> </td>
<td><input name="addnews" type="submit" id="addnews" value="ส่งข้อมูลเข้าสู่ดาต้าเบส" /></td>
</tr>
</table>
</form>
<?php
if(isset($_POST["addnews"]))
{
$images = $_FILES["file"]["tmp_name"];
$width = 210;
$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,$file_name);
ImageJPEG($images_fin,$file);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
$picture = $file_name;
echo '<img src="',$picture,'">';
}
?>
คือว่าโค๊ชนี้ มันอัพรูปแล้ว มันใช้ชื่อรูปเลย ถ้าอัพรูปที่มีชื่อรูปซ้ำมันก็ไม่อัพให้ พอจะมีวิธีให้อัพรูปชื่อซ้ำได้ไหมคับ
Tue 1 Apr 2008 22:26:40
Wed 2 Apr 2008 11:00:55
พี่ ขอเต็มๆได้ไหมอ่าคับ บังเอิญไม่ค่อยเก่งเรื่อง โค๊ดด้วยสิ ขออีกข้อ 1 นะ คือว่าจะให้อัพแต่สกุล JPG ต้องเขียนโค๊ดเพิ่มไงหรอ
Wed 2 Apr 2008 12:52:09
Wed 2 Apr 2008 18:06:08
แง่ไม่เก่งเรื่องโค๊ด ทำมะถูกอ่า อยากให้ พี่เว็บมาสเตอร์เขียวให้ได้ไหม รบกวนหน่อยนะคับ
Wed 2 Apr 2008 20:00:39
Wed 2 Apr 2008 20:09:37
อืมๆ ขอบคุงคับ งมต่อ

















