title: Display $_FILES['image'] after form submit
body: <p>How do i display the image uploaded after the form has been submitted? After the form is submitted it will be a preview page, so i'm not storing the image type BLOB in MySQLyet.  How do i display $_FILES['image']?</p>
  
  <pre><code>&lt;?php
  
  if(isset($_POST['submit'])) {
  
   //preview page
  
  $info = getimagesize($_FILES['image']['tmp_name']);
  $imagetype = $info['mime'];
  $tmpname = $_FILES['image']['tmp_name'];
  $fp = fopen($tmpname,'r');
  $data = fread($fp,filesize($tmpname));
  $data = addslashes($data);
  fclose($fp);
  
  } else {
  ?&gt;
  
  &lt;form enctype="multipart/form-data" action="http://www.example.com/submit" method="POST"&gt;
  &lt;input type="file" name="image" value="" size="50" /&gt;
  &lt;input type="submit" name="submit" value="submit" /&gt;
  &lt;/form&gt;
  
  &lt;?php
  }
  
  ?&gt;
  </code></pre>