title: PHP Deleting a file 24 hours after being uploaded
body: <p>I've made a simple script that allows users to upload html files to a web directory on my server. However, I'd like it so each file is deleted after 24 hours of being on my server. 24 hours for each file, not 24 hours for the entire directory. Here is my code so far... Thank you for your help. :) </p>
  
  <pre><code>&lt;?php 
   $target = "users/"; 
   $target = $target . basename( $_FILES['uploaded']['name']) ; 
   $ok=1; 
  
   if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)
   &amp;&amp; ($_FILES["uploaded"]["type"] == "html")) 
   {
   echo "File: " . $_FILES["uploaded"]["name"] . "&lt;br /&gt;";
   echo "Type: " . $_FILES["uploaded"]["type"] . "&lt;br /&gt;";
   echo "Size: " . ($_FILES["uploaded"]["size"] / 1024) . " Kb&lt;br /&gt;";
   echo "Location: /users/" . $_FILES["uploaded"]["name"]; 
   } 
  
   else {
   echo "Sorry, " . $_FILES["uploaded"]["name"] . " is not a valid HTML document. Please try again.";
   unlink . $_FILES["uploaded"]["name"];
   }
   ?&gt; 
  </code></pre>