title: how can i automatically create thumbnail images from an uploaded file With GD library
body: <p>how can i create automatically tumbling .. I need when i upload original image automatically create thumb and add thumb ( size 200 x 200 ) in folder and insert path of thumb in database $thumb .. i need help .. any one can help me ? </p>
  
  <pre><code>    &lt;?php
  error_reporting(0);
  if ($_POST['submit'])
  {
    $name=basename($_FILES['file_upload']['name']);   
    $t_name=$_FILES['file_upload']['tmp_name'];
    $dir='upload';
    $image_title=$_POST['image_title'];
    $image_details=$_POST['image_details'];
    $image_text=$_POST['image_text'];
    $cat=$_POST['cat'];
    $thumb=$_POST['thumb'];
  
  if(move_uploaded_file($t_name,$dir."/".$name))
     {
  mysql_select_db ($db_name,$conn);
  $qur="insert into images (mid, cid, name, path, image_title, image_details, image_text, thumb, addGby, addGon) 
  values('','$cat','$name','upload/$name','$image_title','$image_details','$image_text','$thumb','$session_name',now())";
  $res=mysql_query($qur,$conn);
  echo 'File Upload sussfully';
  }
  else
  {
  echo 'upload filed!';
  }
  }
  ?&gt;
  
  
  
  &lt;form method="post" action="Addgallery.php" enctype="multipart/form-data"&gt;
  
  &lt;div class="field"&gt;
  &lt;label&gt;image : &lt;/label&gt;
  &lt;input type="file" class="custom-file-input" name="file_upload" id="file_upload"  /&gt;
  &lt;/div&gt;
  
  &lt;div class="field fullwidth last"&gt;
  &lt;input type="submit" name="submit" value="upload" class="bt blue large"  /&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>