[eluser]no-cost lab[/eluser]
thanks for the advice, code is below.
the problem:
whenever a user removes a file and clicks the "back" button,
another file is being deleted.
this is the form used to remove files:
Code:
<form name="remove_proj_form" method="post" action="<?= site_url("site_name/remove_proj")?>">
<input type="hidden" name="selected_proj"/>
</form>
<form name="remove_img_form" method="post" action="<?= site_url("site_name/remove_img")?>">
<input type="hidden" name="selected_img" />
<input type="hidden" name="selected_proj"/>
</form>
this is the link that is removing a file:
Code:
<a href="[removed]remove_img(<?=$i?>,<?=$project['project_id']?>)" style="text-decoration:none">
this is the javascript called by the link above:
Code:
function remove_proj(proj)
{
if (!confirm("Are you sure you want to remove this project?"))
return;
document.remove_proj_form.selected_proj.value = proj ;
document.remove_proj_form.submit() ;
}
thanks again!
No Cost