currently i’m developing a website in a class in my university. i’m using PHP and MySQL.
i have the signup page that when submitted goes to a auxiliary php page that goes through a number of conditions and i’f the form failed in one of the conditions i wanted to return to the signup page that also appeared a line detailing the error.
i wanted to know if i only need to use php or php+javascript.
Thanks in advance.
To get extra points you could use both!
Add the JQuery validate plugin to your form. This will display real time errors to the user. You can’t totally rely on this method though because if the user switches off JS then the validation wornt work 😉
In your PHP run through your validation checks and if one fails then use header (as phpNutt mention above) but I wouldn’t recommend passing the error message in the URL as this can look unprofessional. Instead a number, then just check for the number on the signup page. If it’s there then display the error.