  | 
              
	              
	                
  
    
	 
        ช่วยดูโค้ดส่งเมล์ให้หน่อยว่ามันผิดตรงไหน ช่วยเทพดูโค้ดให้หน่อยดิครับว่ามันผิดตรงไหนโค้ดหน้าจอส่งเมล์     | 
   
  
    |   | 
   
 
 
 
	
		
			  | 
	   | 
	    | 
		
			  | 
	 
	
		
			  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                ช่วยเทพดูโค้ดให้หน่อยดิครับว่ามันผิดตรงไหนโค้ดหน้าจอส่งเมล์ 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> 
<title>sentmail</title> 
</head> 
 
 
<?php 
session_start(); 
 
//ฟังก์ชั่นสำหรับแปลงหน่วยงานจากไบต์ไปเป็นกิโลไบต์, เมกกะไบต์ หรือกิกะไบต์ ตามความเหมาะสม  
function FilesizeToStr($pFileSize) {//เปิด function 
  $sfilesize =  
    ($pFileSize > 1073741824) ? 
	(round($pFileSize / 1073741824, 2) . " Gb") : 
	(($pFileSize > 1048576) ? (round($pFileSize / 1048576, 2) . " Mb") : 
	(ceil($pFileSiz / 1024) . " Kb")); 
    return $sFilesize; 
  }//ปิดfunction 
   
  if (!session_is_registered("ss_Attach"))  {//เปิด if 
    session_register("ss_AttachSize"); 
	$ss_AttachSize = array(); 
  }//ปิด if 1 
   
  $msendfrom = ""; 
  $mreplyto = ""; 
  $mbody = ""; 
  $mcontent = ""; 
  if (isset($paction))  {//เปิด if 2 
    if ($paction == "reply" or $paction == "forward")  {//เปิด if 
	 
    //////////////////////////////////////////////////// 
$ss_mailserver = "{localhost/imap:143}INBOX"; 
$ss_UserID = "thum"; 
$ss_Pwd = "thum"; 
 
    //////////////////////////////////////////////////// 
  $mbox = imap_open($ss_mailserver, $ss_UserID, $ss_Pwd) or die("Could not open Mailbox - try again later!"); 
	 
	 
  //$mbox = imap_open($ss_mailserver, $ss_UserID, $ss_Pwd); 
   
  ////////////////////////////////////////////////// 
	  $header = imap_header($mbox, $pnum); 
	  $from = isset($header->from) ? $header->from : array(); 
	  $fromaddress = $from[0]->mailbox . "@" . $from[0]->host; 
	  $reply = isset($header->reply_to) ? $header->reply_to : array(); 
	  $replyaddress = $reply[0]->mailbox . "@" . $reply[0]->host; 
	  if (isset($reply[0]->personal)) $mreplyto = $reply[0]->personal; 
	  $msendfrom = $msendfrom != "" ? ($msendfrom . " <$fromaddress>") : 
	  						  $fromaddress; 
	  $mreplyto = $mreplyto != "" ? ($mreplyto . " <$replyaddress>") : 
	  						  $replyaddress; 
	  if ($paction == "reply")  {//เปิด if 3 
	    $mcontent = "----- Original Message -----\r\n"; 
		if (isset($header->subject)) 
		  $subject = "Re : " . $header->subject; 
		else 
		  $subject = "Re : "; 
	  }// ปิด if 3 
	  if ($paction == "forward")  { 
	    if (isset($header->subject)) 
		  $subject = "Fwd : " . $header->subject; 
	 else 
	   $subject = "Fwd : "; 
	 $mcontent = "----- Original Message -----\r\n" . 
	 					  "Subject : $subject\r\n" . 
						  "From : $msendfrom\r\n" . 
						  "Data : " . $header->data ."\r\n"; 
						  "--------------------------------------\r\n"; 
	}//ปิดif 2 
	$mbody = imap_fatchbody($mbox, $pnum, 1);  
	$mcontent .= $mbody; 
	imap_close($mbox); 
   
 } //ปิด if 1 
 else { 
   $paction = ""; 
 }//ปิด function 
 ?> 
  
  
 <body onload='document.ComposeForm.cContent.focus()'> 
 <table width="100%"> 
 <tr bgcolor="#CFCFCF"> 
   <td width="100%" height="30"><font size="2" color="#FFFFFF"><b>ส่งจดหมาย</b></font> 
</table> 
  
 
<form name="ComposeForm" method="post" action="compose1.php"> 
<input type="submit" name="btsend" value="ส่งจดหมาย" /> 
<table> 
<tr><td>ส่งถึง 
		<td><input type="text" name="cSendTo" size="60" 
        		<?php 
				echo ($paction == "reply" ? " value='$mreplyro'" : ""); 
				?>> 
<tr><td>สำเนาถึง<td><input type="text" name="cCCto" size="60" > 
<tr><td>สำเนาลับถึง<td><input  type="text" name="cBCCTo" size="60"> 
<tr><td>หัวเรื่อง 
		<td><input type="text" name="cSubject" size="60" 
        		<?php 
				echo (isset($subject) ? " value='$subject' " : ""); 
				?>> 
</table> 
<textarea name="cContent" cols="80" rows="16"> 
<?php echo $mcontent; ?> 
</textarea> 
 
<form enctype="multipart/form-data" name="UploadForm"  
		  method="post" action="compose_upload.php"> 
Attach : <input type="file" name="cAttachfile" size="56" /> 
<br><input type="submit" name="btsubmit" value="เพิ่มไฟล์" /> 
</form> 
 
 <form enctype="multipart/form-data" name="UploadForm"  
		  method="post" action="compose_upload.php"> 
Attach : <input type="file" name="cAttachfile" size="56" /> 
<br><input type="submit" name="btsubmit" value="เพิ่มไฟล์" /> 
</form> 
 
<form name="attachForm" method="post" 
			action="compose_del.php"> 
<table width="100%" bgcolor="#DFAF00" border="1"> 
<tr><td> 
	<table width="100%" bgcolor="#BFBFBF"> 
<tr><td><font color="#FFFFFF"><b>ไฟล์แนบ</b></font> 
<td align="right"><input type="submit" name="btDel" value="ลบไฟล์" /> 
	</table> 
<tr><td> 
<table width="100%" bgcolor="#FFFFFF"> 
<?php 
foreach ($ss_Attach as $key => $eachAttach) { 
	print "<tr><td>"; 
	print "<input type='checkbox' name='cbxDel[$ket]'> " . 
			"<font size='2' color='#004F9F'>" .  
			"  " . "<font color='#0000FF'>" . 
			FileSizeToStr($ss_AttachSize[$key]) . "</font></font>"; 
} 
?> 
</table> 
</table> 
 
</body> 
 
 
มัน error ดังนี้ 
[Tue Dec 15 14:34:12 2009] [error] [client 127.0.0.1] PHP Parse error:  parse error, unexpected $end in C:\\Apache\\Apache2\\htdocs\\mail\\compose.php on line 146, referer: http://localhost/mail/
 
 
  Tag : - - - -              
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2009-12-15 14:34:29 | 
                      By :
                          0mmm0 | 
                      View :
                          945 | 
                      Reply :
                          5 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  | 
	 
	
		
			  | 
		  | 
		
			  | 
		
			  | 
	 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 unexpected $end  ?? 
 
เดานะ  
ตัวพวก วงเล็บ อะไรซักอย่างนี่แหละ ไม่ครบคู่มั้งครับ แถวๆบน บรรทัดที่ 146 
 
เดาเอาตามเออเรอ                        
               
               | 
             
            
              
			                                
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2009-12-15 16:43:25 | 
                        By :
                            loginthc | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 Code (PHP) 
</table>
</table>
  
ปิดเกินหรือเปล่าครับ                        
               
               | 
             
            
              
			                                
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2009-12-15 18:05:46 | 
                        By :
                            popnakub | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 line 146 มันคือตรงไหนละเนี้ย                        
               
               | 
             
            
              
			                                
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2009-12-15 22:37:05 | 
                        By :
                            plakrim | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 แถวสุดท่ายเลยครับ </body>                        
               
               | 
             
            
              
			                                
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2009-12-16 11:44:33 | 
                        By :
                            0mmm0 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 } //ปิด if 1 
else { 
$paction = ""; 
}// ลืมปิด else 
}//ปิด function                        
               
               | 
             
            
              
			                                
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2009-12-16 11:52:50 | 
                        By :
                            xbeginner01 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |