Do in sections, forma, formb, etc. The session can handle it.
Also pre validate on page, perhaps using js.
Of course validate on back end as needed.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Has anyone come up with a good solution of how to get the previous URL to a page that does a POST to itself to save form data. For example a settings page that is linked to from several pages.
As of now the only thing I can think of is storing the previous page of any page that needs this in the session, which will end up storing a huge amount of info.
I already dug into the source and didn't see any solutions there either. The issue is after doing a POST, and redirecting back to the same url, url()->previous() becomes the current URL (as it should based on how it works).
put the return URL in the url as a url encoded parameter
/user/1/settings?from=%2Fuser%2F1
then make sure this is persisted in the form post and the redirect
on the first visit to the settings function, if it is not set, set it using the previous url
Please or to participate in this conversation.