ZenitH-AT / learningspace

Accommodation Website Project (ITSP200)
GNU General Public License v3.0
0 stars 1 forks source link

Implement PRG to avoid duplicate form submissions #50

Closed ZenitH-AT closed 6 years ago

ZenitH-AT commented 6 years ago

https://en.wikipedia.org/wiki/Post/Redirect/Get

ZenitH-AT commented 6 years ago

The main issue is that our system is very susceptible to page refreshes resubmitting form data and inserting duplicate records. We don't have a lot of time but I will research more later in the week.

ZenitH-AT commented 6 years ago

Just need to implement something like this:

$get_info = "?paid"; //for example... we dont always need to use this

header("Location: ".$_SERVER['REQUEST_URI'].$get_info);
exit();
ZenitH-AT commented 6 years ago

We would include $get_info in places where there is an if statement that uses the get parameter (e.g. payment page success dissmissable).

ZenitH-AT commented 6 years ago

This could be done to remove all the lazily implemented js popups i used