Skip to content

Comment on How best to navigate to a PHP page after a form submit?

Comments

After the user submits a form, it is usually a good idea to display a confirmation page. It might be jarring to go directly to the privacy page. I would set it up like this:

  index.php?page=contact -> shows the form
  index.php?page=contact-submit -> shows the confirmation with privacy policy text

The privacy page is just an example. Your scenario replaces it with a confirmation page. So the problem still stands: How do you go to the ?page=contact-submit page? Do you use header()? Is that the canonical way?

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.