  | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 แปะโค้ดเป็นรูปภาพอีกแล้ว ก๊อปโค้ดมาแปะมันยากกันขนาดนั้นหรือ?                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-04-16 20:44:42 | 
                        By :
                            mr.v | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 โค้ดอัปโหลด เข้าฐานข้อมูล 
 
<?php 
$serverName = "localhost"; 
   $userName = "root"; 
   $userPassword = "1234"; 
   $dbName = "test"; 
 
   $conn = mysqli_connect($serverName,$userName,$userPassword,$dbName); 
	mysqli_query($conn,"SET NAMES UTF8"); 
 
if(isset($_POST['submit'])!=""){ 
   
  $title=$_POST['title']; 
    $teaser=$_POST['teaser']; 
  $poster=$_POST['poster']; 
 
  $desc=$_POST['desc']; 
  $name=$_FILES['photo']['name']; 
  $size=$_FILES['photo']['size']; 
  $type=$_FILES['photo']['type']; 
  $temp=$_FILES['photo']['tmp_name']; 
  $date = date('Y-m-d H:i:s'); 
  $caption1=$_POST['caption']; 
  $link=$_POST['link']; 
 
  $pic=$_FILES['photo']['picture']; 
    
  $datepic = date('Y-m-d H:i:s'); 
 
  move_uploaded_file($temp,"sale/".$name); 
 move_uploaded_file($temp,"sale/".$pic); 
 
 
 
$query=$conn->query("INSERT INTO sale (title,teaser,fdesc,datepic,name,date,poster,picture) VALUES ('$title','$teaser','$desc','$datepic','$name','$date','$poster','$pic')"); 
 
 
if($query){ 
header("location:addsale.php"); 
} 
else{ 
die(mysqli_error($conn)); 
} 
} 
?> 
 
 
 
 
โค้ดหน้าฟอร์ม 
<table cellpadding="0" cellspacing="0" border="0" class="table table-bordered"> 
		 
			 
			 
		 
			<tr><td><form enctype="multipart/form-data"  action="addsale.php" id="wb_Form1" name="form" method="post"> 
				<br>    <img src="image/add.png"  style="width:40px;height:40px;" ><font size="5">  เพิ่มข้อมูลจัดซื้อจัดจ้าง</font> <br> 
					<hr size=1 noshade width=100%> 
					  <font >หัวเรื่อง :</font><br> 
				  <input type="text" name="title" style="height:40px;width:750px;"  required><br><br> 
				 
		  <font >ผู้โพสต์ :</font><br> 
		  <select name="poster" id="poster" style="height:40px;width:750px;"> 
          <option value=PrimaryCare selected>PrimaryCare</option></select><br><br> 
 
 
				  <font >รายละเอียดย่อ :</font><br> 
				  <input type="text" name="teaser" style="height:40px;width:750px;"  required><br><br> 
				 
				 
				  <font >รายละเอียด :</font><br> 
				  <textarea name="desc"  style="height:200px;width:750px;" class="input-xlarge"  required></textarea><br><br> 
					  <img src="image/fol.png"  style="width:25px;height:25px;" >  Add Files : <br> 
					    <input type="file" name="photo" id="photo"  required="required"><br> 
										  <img src="image/fol.png"  style="width:25px;height:25px;" >  Add Picture : <br> 
					    <input type="file" name="photo" id="photo"  required="required"> 
 
					<input  type="submit" class="btn btn-danger" value="Save" name="submit" style=" float:right;"><br><br> 
			</form></tr></td></table>                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2018-04-17 08:45:14 | 
                        By :
                            sprinter21 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
      		  
	
     |