title: How can I change the name of an image that is being uploaded to my server?
body: <p>When someone uploads an image to my server, it uploads as the name they have for the image on their computer. I want the image name to become a short number as the name instead of the name, because when someone uploads an image as the same name, it overwrites it.</p>
  
  <p>Here is my script where the names are defined:</p>
  
  <pre><code>if(isset($_FILES['fileup']) &amp;&amp; strlen($_FILES['fileup']['name']) &gt; 1) {
  
    $uploadpath = $uploadpath . basename( $_FILES['fileup']['name']);
  
    $sepext = explode('.', strtolower($_FILES['fileup']['name']));
  
    $type = end($sepext);
  
    list($width, $height) = getimagesize($_FILES['fileup']['tmp_name']);
  
    $err = '';
  </code></pre>