|
 |
|
การอัพโหลดรูปครับ ทำในเขียนที่มีลง appserv สามารถทำได้ แต่พอทำในเครื่อง server OS fedora ทำไม่ได้ |
|
 |
|
|
 |
 |
|
การอัพโหลดรูปครับ ทำในเขียนที่มีลง appserv สามารถทำได้ แต่พอทำในเครื่อง server OS fedora ทำไม่ได้
Code (PHP)
<?
include "conn.inc.php";
$id_ceo="$_POST[txt_idceo]";
$name_ceo="$_POST[txt_nameceo]";
$select="SELECT * FROM tbceo WHERE name_ceo ='$name_ceo'";
$result=mysql_query($select);
$row=mysql_fetch_array($result);
$num=mysql_num_rows($result);
if($num >0 ){
echo "<script>alert('คุณไม่สามรถเพิ่มตำแหน่งนี้ได้ เนื่องจากมีตำแหน่งนี้อยู่แล้ว');window.location='add_ceo.php';</script>";exit();
}
$sql="INSERT INTO tbceo (id_ceo,name_ceo,level)VALUES('$_POST[txt_idceo]','$_POST[txt_nameceo]','$_POST[dll_level]')";
if(trim($_FILES["upload_file"]["tmp_name"]) != "")
{
$images = $_FILES["upload_file"]["tmp_name"];
$width=70; //*** 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,"../img/profile/".$id_ceo.'.jpg');
ImageDestroy($images_orig);
ImageDestroy($images_fin);
}
if (!mysql_query($sql,$Connect)) {
echo "<script>alert('ไม่สามารถเพิ่มหน่วยงานได้');window.location='add_ceo.php';</script>";exit(); }
echo "<script>alert('คุณได้เพิ่มตำแหน่งเรียบร้อยแล้ว');window.location='add_ceo.php';</script>";exit();
mysql_close($Connect);
?>
ไม่ทราบว่าผิดตรงไหนครับ
Tag : - - - -

|
|
 |
 |
 |
 |
Date :
2009-11-04 15:39:40 |
By :
oasiis |
View :
1609 |
Reply :
16 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ตรวจสอบ permission ของ Folder ที่ up รูปไปใส่ว่ากำหนดสิทธิ์ให้เขียนได้หรือไม่
|
 |
 |
 |
 |
Date :
2009-11-04 16:12:17 |
By :
trans |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ช่วยบอกหน่อยครับ
|
 |
 |
 |
 |
Date :
2009-11-04 18:00:11 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เปิด program ftp click ขวาที่ folder ที่จะ upload ขึ้นไป แล้ว set permission เป็น 777
|
 |
 |
 |
 |
Date :
2009-11-04 18:37:47 |
By :
peterxp |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$id_ceo="$_POST[txt_idceo]";
05.
$name_ceo="$_POST[txt_nameceo]";
อันนี้ไม่ต้อใส่ฟันหนูครับ
$id_ceo=$_POST[txt_idceo];
$name_ceo=$_POST[txt_nameceo];
|
 |
 |
 |
 |
Date :
2009-11-04 21:39:56 |
By :
deawx |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พี่เดี่ยวX ตาดีจริงๆ
|
 |
 |
 |
 |
Date :
2009-11-04 22:25:43 |
By :
panyapol |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
chmod 777 ชื่อ folder ที่จะ upload
chmod 777 directory
ตัวอย่าง ชี้พาสแบบ full
#chmod 777 /var/www/html/images
* images คือ ชื่อ folder ที่จะ upload
|
 |
 |
 |
 |
Date :
2009-11-05 11:57:35 |
By :
ideaza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่เข้าใจครับ
|
 |
 |
 |
 |
Date :
2009-11-05 12:00:11 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
path web คือ ?
directory ที่เก็บภาพชื่ออะไร
คุณอยู่ mode อะไร command or Graphic
|
 |
 |
 |
 |
Date :
2009-11-05 13:20:55 |
By :
ideaza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณอยู่ mode อะไร command or Graphic
|
 |
 |
 |
 |
Date :
2009-11-05 13:37:46 |
By :
ideaza |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ทราบว่าต้องทำยังไง? ครับ
|
 |
 |
 |
 |
Date :
2009-11-05 18:26:39 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ทราบว่าต้องทำยังไง? ครับ
|
 |
 |
 |
 |
Date :
2009-11-05 22:59:44 |
By :
oasiis |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากๆๆนะครับ
|
 |
 |
 |
 |
Date :
2010-12-27 22:36:17 |
By :
pip147258 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|