Avoid Direct Navigating to Form

How do you avoid visitors going to your page directly?

On my homepage, there is a single field that asks for email, once they’ve filled that, they will be taken to the second page /details/ where they will place their name and contact number before the whole form could be processed and send to email. But for some reason people are finding my domain.com/details/ page and skip the email. Is there a way to check the Tii::$app->session[‘email’] first before they could fill the 2nd page form?

Well you’ve answered your question there. On the first page set a flag in the session upon successful completion.

In the controller action for the second page, check for the flag and redirect to the first page if it hasn’t been set.