So I am working on this site and I'm constantly wondering which method of form validation/verification is better: JavaScript or PHP? I put together some really nice PHP that sanitizes user input and upon error (e.g. if a required field is empty), it sends an error message via GET back to the form.
Also, which is more secure. I'm not so sure if GET is a good method to pass back variables. In this case, I only have two possible variables - ?success=1 and ?error=1. The PHP script shows an otherwise hidden DIV if one of these is true. Is there potential for vulnerability with this method?
Anyone have experience with this?
Also, which is more secure. I'm not so sure if GET is a good method to pass back variables. In this case, I only have two possible variables - ?success=1 and ?error=1. The PHP script shows an otherwise hidden DIV if one of these is true. Is there potential for vulnerability with this method?
Anyone have experience with this?