0

I wrote 3 custom forms using hook_menu() for resetting password. All forms have these functionalities.

Form # 1. On submit, sends OTP (code) after entering mobile number and redirect to form # 2

From # 2. On submit, validate OTP and redirect to form # 3

From # 3. The last form where user can enter password and confirm password and submit.

How to restrict user from accessing form#2 without submit form#1?

                        AND

How to restrict user from accessing form#3 without submit form#2?

1 Answer 1

0

Check the referring page using $_SERVER['HTTP_REFERER'] if it doesn't match the previous page either throw an error or redirect him to the first page.

1
  • Can you please explain it in detail and with an example. I've tried while it will not redirect to the form # 3 however redirect to form # 2 successfully. Commented Nov 20, 2017 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.