  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                ปัญหาก็คือ ผมจะแทรกรูปภาพประจำตัว โดยใช้ Code ด้านล่างนี้ เมื่อเพิ่มไปแล้ว ข้อมูลชื่อรูปภาพ เข้าฐานข้อมูลอยู่ครับ แต่ !!! 
ไฟล์ภาพ ไม่ Copy ไปยังโฟนเดอร์ PicUser ไม่รู้เพราะเหตุใด ครับ ซึ่ง Code นี้ถูกรันบน Server ของคณะ 
/// 
ตรงกันข้าม ไฟล์นี้ มีรันใน localhost ก็สามารถ ใช้งานได้ปกติดี ครับ.... 
ปล.โปรดช่วยด้วยคร้าบบบ T_T ขอบพระคุณเป็นอย่างยิ่ง 
 
 
Code 
---------------------------------------------------------------------------------------------------------------------------------------------- 
		$img=$_FILES["inPic"]; 
		if($img["size"]>0){ 
		 $fileupload = $_FILES["inPic"]["tmp_name"]; 
		 $fileupload_type = strstr($_FILES["inPic"]["name"],"."); 
		$fileupload_name = md5(date("Ymdis")).$fileupload_type; 
			if ($fileupload) { 
			$array_last=explode(".",$fileupload_type);    
			$c=count($array_last)-1; $lastname=strtolower($array_last[$c]) ;    
		 
				if ($lastname=="gif" or $lastname=="jpg" or $lastname=="jpeg" or $lastname=="png") {  
						copy($fileupload,"PicUser/".$fileupload_name);  
				//-- โค้ด ปรับขนาดของภาพ --// 
	$images = "PicUser/".$fileupload_name; 
    $height = 255; //กำหนดขนาดความสูง 
    $size = getimagesize($images); 
    $width = round($height*$size[0]/$size[1]); //ขนาดความกว้่างคำนวนเพื่อความสมส่วนของรูป 
    	if($size[2] == 1) { 
        $images_orig = imagecreatefromgif($images); //resize รูปประเภท GIF 
    	}else if($size[2] == 2) { 
        $images_orig = imagecreatefromjpeg($images); //resize รูปประเภท JPEG 
		}else if($size[2] == 3) { 
    	$images_orig = imagecreatefrompng($images); //resize รูปประเภท png 
    	} 
	 
    $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, $images); //ชื่อไฟล์ใหม่ 
    imagedestroy($images_orig); 
    imagedestroy($images_fin); 
 	//-- โค้ด ปรับขนาดของภาพ --// 
			}else{ 
			echo "ERROR : ไม่สามารถ Upload ไฟล์ข้อมูลได้";  
			}    
		 }else{ 
		 echo "<h3>ERROR : ไม่สามารถ Upload รูปภาพ</h3>";  
		} 
		$sql2="update member set mem_img='$fileupload_name' where mem_id='$_COOKIE[memid]'"; 
		$q2=mysql_query($sql2) or die ("แก้ไขรูปภาพสมาชิกไม่ได้"); 
		} 
---------------------------------------------------------------------------------------------------------------------------------------------- 
 
 
  Tag : PHP               
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2011-12-25 22:36:22 | 
                      By :
                          YondaiMe13 | 
                      View :
                          1050 | 
                      Reply :
                          5 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  |