I am trying to delete an image using a button.
when i click the button i use
onClick"'.delete_files(assets/uploads/.$image->filename).'"
But nothing is happening. The image is still where it was before I clicked the button.
When I do a print_r($image->filename)
I get the 3 names of my images shown on the page.
this is my code:
<table class="images">
<tr>
<br/>
<? foreach($images as $image) { ?>
<td>
<a href="assets/uploads/<?= $image->filename ?>" rel="lightbox" title="<?= $image->filename; ?>">
<img src="<?php echo base_url();?>assets/uploads/<?= $image->filename; ?>" width="200px">
</a>
<?= '<input type="button" value="Delete" onclick"'.delete_files('assets/uploads/'.$image->filename).'"><br/>'; ?>
</td>
<? } ?>
</tr>
</table>
I wonder if the path is right. but the assets folder is in my root. httpdocs/assets/uploads and my codeigniter folder is at httpdocs/application/ so that should work.