adrianmak Posted June 12, 2017 Share Posted June 12, 2017 There is a page name thank-you page, which is used for all submission form, a success submission will redirect to this thank-you page. I would like to stop people to access this page directly and checking if it is not redirect from other page with form submission, it will redirect to home page automatically. Link to comment Share on other sites More sharing options...
Zeka Posted June 12, 2017 Share Posted June 12, 2017 Hi @adrianmak When you make redirect from your form to "thank you" page, you can add some get parameter to the link like: thank-you/?submit=success and then in "thank you" page template check if there this get parameter, if not - redirect to homepage. 2 Link to comment Share on other sites More sharing options...
DaveP Posted June 12, 2017 Share Posted June 12, 2017 If I understand correctly, that a successful form submission is then redirected to /thank-you/, I would use $session. Then you could do something like this <?php // Form A if($success){ $session->formSuccess = 'formA'; } // or 'formB' etc on any other forms // then redirect to /thank-you/ and then <?php // /thank-you/ if($session->formSuccess){ switch($session->formSuccess){ case 'formA': $message = 'Thanks for submitting Form A'; break; case 'formB': // etc } $session->formSuccess = ''; } else { //redirect to /home/ or wherever } 5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now