Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Bug list  »  Bug #284

Viewing Bug Advanced Details [ Jump to Bugnotes ] [ Bug History ] [ Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000284 documentation feature always 2004-11-27 18:57 2004-11-27 22:02
 
Reporter marianov View Status public  
Assigned To
Priority normal Resolution open Platform Firefox
Status acknowledged Duplicate ID OS Linux
Projection none Version
ETA none Product Version 5.4 (stable)
  Product Build
  Votes 1
 
Summary Browser refresh causes duplicate inserts.
Description When the user clicks refresh on the browser after an insert PME inserts a duplicated record in the table.
I havent found a way to avoid it (aside from using a unique index, which is not always posible).
In other php apps i have used something like:


if (!isset($_SESSION['pcount']))
$_SESSION['pcount'] = 0; //$pcount is a "form post counter"

function formrefresh() { return $_REQUEST['pcount'] !=
$_SESSION['pcount']++; }

and then when building each form I add:
<input type=hidden name=pcount value=<?=$_SESSION['pcount'] ; ?> >

So before taking action I can check that the user is not submitting a form like this:

if (!formrefresh() ) {
//insert the record
} else {
// show a new empty form or redirect to the list of records
}

Do you think it would be easy to add this kind of feature to PME ?

Thanks,

Mariano
Steps To Reproduce
Additional Information / Solution
Attached Files

Bug Notes
michal
2004-11-27 20:31

[this is not website/homepage related, more docuemntation issue.]

yes,

have a look at trigger insert before (to stop the insert proccess), and $opts['cgi']['persist'] option (to keep the hidden variable).
 
nepto
2004-11-27 21:55

Well, concerning to addition of this into core class, I do not thing it is a good idea. I do not want to mess/bloat core class with things like $_SESSION and so on.

upravené: 2004-11-27 21:57
 
hbernard
2004-11-27 22:02

Agreed.

This is (as michal said) a documentation issue.
 

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy