title: Delete temporary files php
body: <p>I have a page that which add new User.</p>
  
  <p>The user have file attachment option.</p>
  
  <p>I created a temporary table and directory to upload file and track the user data.</p>
  
  <p>The problem is the user is not yet added ,so i cannot save these files under the contact.</p>
  
  <p>what i am doing is saving the files and tracking using a temp table and once the user is added moving those files under that user.</p>
  
  <p>Assume that user uploaded the files and closed the page without adding user.</p>
  
  <p>Then how can i delete the temp files and table values ?</p>
  
  <p>can i use the browser close event ? alternatively is there anyway to do this in php [because i am new in php] ?</p>
  
  <p>I am using <strong>Codeignitor</strong>  - it will be very helpful if i get answer respective to CI.</p>
  
  <p>Thanks in advance.</p>