CodeIgniter Forums
unwanted repeated upload - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: unwanted repeated upload (/showthread.php?tid=32372)



unwanted repeated upload - El Forum - 07-21-2010

[eluser]no-cost lab[/eluser]
Hi Guys,
users of my application can upload files,
but when going back the upload happens again.

Any idea how to prevent this?

Thanks in advance!

No-Cost


unwanted repeated upload - El Forum - 07-21-2010

[eluser]frist44[/eluser]
Post some code. You'll get a better response that way.


unwanted repeated upload - El Forum - 07-21-2010

[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(&lt;?=$i?&gt;,&lt;?=$project['project_id']?&gt;)" 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