Basically I wish to write my registration page in such a way that errors (such as invalid username, short password, too long username, invalid email, etc.) are returned (at the same time) when user is redirected back to the same page.
I have often seen a lot of websites that have this:
There are X errors in the data you submitted:
- Username is too short
- Password is too short
- Etc. etc.
And these errors are returned when the user submits the form and is redirected back.
I thought of returning the errors via numbers in $_GET however I’d like to avoid this. And I also would like to avoid using JS/AJAX and $_SESSION.
With a library:
Without a library: