Reputation: 1120
I'm a beginner in PHP trying implementing a simple registration system for a website. The login form processing is done in a special file, where if there were empty or invalid data submitted (email and password) I redirect the user to the main page (the same with the login form) with a special query to handle the error and create a message.
The problem is: the form is empty again. If the user just forgot one field, I'd like to fill the other field automatically. How can I implement this feature? Pass the existing field also in a query? I'd like to avoid doing this, but not sure if it is possible to pass in another way (POST or something like).
Upvotes: 4
Views: 697
Reputation: 1460
why are you posting values on a seperate file and then redirecting. just post the values directly on the same page where the login form is and there you can handle it very easily with conditions of matched or not matched.
Upvotes: 2