Skip to content

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

Comments

Well, to start with, you shouldn't be letting your choice of IDE dictate your code architecture. IDEs are a developmental aid (some might say a developmental crutch), so if yours is getting in your way, it's not doing its job and you should reconsider your use of it.

When you talk about using "the PHP function header()", I presume that you intend to use it to issue an HTTP redirect response. Think about what you're doing: HTTP is stateless, but you want to preserve state across page requests (the privacy page is a different resource to the contact form, as your uneasiness about not changing URIs shows you're aware). The place to do this, generally speaking, is in the session.

It's not dictating the code architecture -- it's one of many factors to consider

Naturally I'm using a session variable. But the URL mismatch remains.

AboutSource Built by g1lg1l

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