title: PHP How to use old image if no image selected
body: <p>How is it possible to use old image if no image is selected?</p>
  
  <p>its a profile page when someone updates his profile but don't select the image for update then old image should be remained there..</p>
  
  <p>should it be like this if-else statement or there would be some other way??</p>
  
  <pre><code>    //check if file is selected.
      if (empty($_FILES['profilepic']))
      {
                   //if file selected this code should run
  
           $fileselected="file selected";
      }
      else
      {
                  //this executes if file not selected
          $fileselected="No File Has Been Selected";
      }
  
  echo $fileselected;
  </code></pre>
  
  <p>How it should be coded??</p>