Re-fill form after redirect

I am new to PHP trying to implement a simple registration system for a website. Processing the login form is performed in a special file, in which if empty or invalid data (email address and password) was presented, I redirect the user to the main page (the same with the login form) with a special request to process the error and create a message.

The problem is this: the form is empty again. If the user simply forgot one field, I would like to fill out another field automatically. How can I implement this feature? Pass existing field also in request? I would like to avoid this, but not sure if it is possible to switch in another way (POST or something like this).

+4
source share
1 answer

why you publish the values ​​in a separate file and then redirect. just publish the values ​​directly on the same page on which the login form is located, and you can easily process it with the terms agreed upon or not matched.

+1
source

Source: https://habr.com/ru/post/1388188/


All Articles