You need to load this action using Javascript. If you use jQuery, you cannot try something like this
Your javascript
<script type="text/javascript"> $('.delete').live('click',function(){ deleteFile( $(this).attr('id') ); }); function deleteFile(id){ $.ajax({ url: 'deletefile.php?fileid='+id, success: function() { alert('File deleted.'); } }); } </script>
Your deletefile.php file looks like this.
<?php $fileid = $_GET['fileid'];
And your link should have the following structure
printf("<a id='%s' class='delete'>Delete</a>",$youridfile);
eusoj source share