title: How I can resize image after upload it in php
body: <p><br />I have a problem I can't solve it :(, I want to make code resizes image after upload it and save it in folder
  <br /><br />
  my code:<br /></p>
  
  <pre><code>&lt;form method="post" action="" enctype="multipart/form-data"&gt;
  &lt;?php
  $filename=$_FILES['f1']['name'];
  $file=$_FILES['f1']['tmp_name'];
  $ext=strtolower(end(explode(".",$filename)));
  if ($ext=="jpg" or $ext=="jpeg" or $ext=="png" or $ext=="gif" ){
  $newfilename= $t2.".".$ext;
  copy ($file,"images/profiles/".$newfilename);
  ?&gt;
  &lt;table dir="ltr" width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
  &lt;tr&gt;
  &lt;td align="right" width="84%"&gt;
  &lt;input name="f1" type="file" class="btn" id="f1"  value=""/&gt;&lt;/td&gt;
  &lt;td width="16%"&gt;image:&lt;/td&gt;
  &lt;/tr&gt;&lt;tr&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>