title: php resize image on upload precess
body: <p>I know this question was asked before <strong><a href="https://stackoverflow.com/questions/12757005/php-resize-image-on-or-before-upload">here</a></strong>, but i really need some one to explain me how can i use this in my situation.</p>
  
  <p>This is my simple php script tha uploads the image:</p>
  
  <pre><code>&lt;?php
      if(isset($_POST['submit'])){
          $ipad=$_SERVER['REMOTE_ADDR'];
          //This is the directory where images will be saved 
          $target = "images/"; 
          $email=$_POST['email'];
          $target = $target . basename( $_FILES['photo']['name']);  
          //This gets all the other information from the form 
          $pic=($_FILES['photo']['name']); 
          $resultes =mysql_query("SELECT * FROM image WHERE `name` = '$pic'");
  
          if($pic != '' and $email != '' and mysql_num_rows($resultes) == 0){
              mysql_query("INSERT into image(name , email, ipadd) values ('$pic','$email','$ipad' )"); 
              //Writes the photo to the server 
              if(move_uploaded_file($_FILES['photo']['tmp_name'], $target)) { 
  ?&gt; 
                  &lt;div class="error"&gt;The file has been uploaded, and your information has been added to the directory&lt;/div&gt;
  &lt;? }
          } else { 
          //Gives and error if its not 
          echo '&lt;div class="error"&gt;'. $gal_error_noupload .'&lt;/div&gt;'; 
          } 
          $pic=='';
      }           
  
  ?&gt;
  </code></pre>
  
  <p>How can I add the resize code? That is give <a href="https://stackoverflow.com/questions/12757005/php-resize-image-on-or-before-upload">here</a></p>