PHP Post/Redirect/Get Back Button Issue -


i'm using prg pattern in application i'm building. there multi-page form validate , save information in database upon posting each page's form. if submission passes validation redirect user next page of form. works you'd expect, , if used hits button goes pervious page no resubmit warnings, etc.

because form complex, in effort make user friendly, when validation fails write user's entries $_session , redirect them same page appropriate messages. works well.

the issue if user makes repeated posts fail validation, button history gets loaded same page, need click button multiple times expected previous page. i'm looking way javascript's window.location.replace when redirecting on failure user won't have hit button multiple times previous page.

is possible in php header or need use javascript accomplish this?

one option submit via ajax validation, if validation goes through correctly submit page. otherwise display error messages , stay on same page.


Comments