title: upload image with filename cannot be empty
body: <p>I am doing a page with upload images and everything are fine. But the problem appeared when i accidentally uploaded image without choosing any images. A warning came out "Warning: file_get_contents(): Filename cannot be empty". I try to solve but the warning is still appeared. Did i need to add anything? What should i do in order to remove that warning? This is my php code</p>
  
  <pre><code>&lt;form name="form1" action="" method="post" enctype="multipart/form-data"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt;select files&lt;/td&gt;
  &lt;td&gt;&lt;input type="file" name="f1"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;td&gt;&lt;input type="submit" name="submit1" value="upload"&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" name="submit2" value="display"&gt;&lt;/td&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  
  &lt;?php
  $con = mysqli_connect("localhost","root","");
  mysqli_select_db($con,"image")or die(mysqli_error($con));;
  if(isset($_POST["submit1"]))
  {
      $image = addslashes(file_get_contents($_FILES['f1']['tmp_name']));
      $sql ="INSERT INTO images (username, image)  VALUES('$_SESSION[username]','$image')";
      $result=mysqli_query($con, $sql);
  
  }if(isset($_POST["submit2"]))
  {
      $sql = "SELECT username, image FROM images where username = '$_SESSION[username]' ";
      $result = mysqli_query($con,$sql);
      echo"&lt;table&gt;";
      echo "&lt;tr&gt;";
      while ($row=mysqli_fetch_assoc($result))
      {
          echo "&lt;td&gt;";
          echo '&lt;img src="data:image/jpeg;base64,'.base64_encode($row['image']).'" height="100" width="100"/&gt;';
          echo "&lt;/td&gt;";
  
  
      }
      echo "&lt;/tr&gt;";
  }
  
  ?&gt;
  ?&gt;
  </code></pre>