I'm trying to create a basic login system and i'm running into a problem. I learned that you should send form values using the form action to another file that will process the input data.
But the problem is, when an error occurs and I send them back to the register page the values of their input are gone, I could of course place them in a session variable(like I do with the error message) but it just doesn't feel like the correct way.
So my questions is: Why should I use the form action attribute if I can just put the code on the same page and if an error occurs just do value="<?php echo $_POST['username']?>"
to make the value show up in the input?
Kind regards.