Add re-populate form on submission error

This commit is contained in:
osaajani 2020-08-17 21:05:01 +02:00
parent d52db2e1d2
commit 7277f1e98d
11 changed files with 44 additions and 29 deletions

View file

@ -13,6 +13,10 @@
$_SESSION['csrf'] = str_shuffle(uniqid().uniqid());
}
//Save previous $_POST for re-populate forms on validation errors
$_SESSION['previous_http_post'] = $_SESSION['http_post'] ?? [];
$_SESSION['http_post'] = $_POST;
//Routing current query
try
{