1
I am currently working on a new project, using Codeigniter, it is my first experience and I do not find great help, I want the user to be able to delete a photo chosen by him from his folder, The controller: `
public function delete()
{
delete_files('C:\wamp64\www\uploads\_back');
}`
The view:`
{imagesback}
<div class="col-sm-2">
{ver}
<img src="{path}" style="width: 100%; height: 100px;">
<p>{name}</p>
<button name="nameimagetodelete" onclick="do_delete('{name}')"></button>
</div>
{/imagesback}
`
and Javascript`<
script type="text/javascript">
function do_delete(name){
var r = confirm("You sure?");
if (r == true)
{
window.location.href = "<?php echo site_url('admin/delete');?>?name="+name;
}
else
{
x = "Action canceled";
alert(x);
}
}
</script>
`
Thank you in advance!
https://stackoverflow.com questions português
– Willian Coqueiro
Welcome to the Stackoverflow in Portuguese. As the name suggests, the official language used here is Portuguese. So, could you please translate your question? If you prefer, you can also ask the same question on Stackoverflow website in English.
– NoobSaibot
Sorry I don’t understand! Prefer the question in English?
– Gabriel Gomes
Yes of course I will translate! I thank you from already help!
– Gabriel Gomes
@Gabrielgomes the link edit is below the tags, to format the code, just select it and hit the shortcut
CTRL+K
or in the boar{}
in the editor, enjoy making the Tour to learn how the site works.– NoobSaibot
is already edited @Noobsaibot
– Gabriel Gomes