I have a register form and various other forms on my website the require server-side validation with php. The only problem is I have tried a couple of ways and I do not know how to completely do it correctly.
I have tried sending the form to itself with $_SERVER['PHP_SELF']; but that does not work the way i want it to. When they click on the submit button, I need it to check through my validation code, and they output certain things like, you need to enter a username, or you have entered an invalid username right next to the textfield. I am unsure of how to format this.
I though of taking it to a page which checks for certain errors, and then sends its to a new page, which would be the registration page with the correct error already printed, very time consuming, obviously a dumb way of doing things I know, but I have been reading all these validation posts, and nothing has helped on where to put the validation code and how to direct my pages so everything runs smoothly.
If anybody has just a little bit of direction, or maybe some links I could look at, that would be great.
Thanks,
Brendan