views:

101

answers:

2

I don't know in my site someone register without filling whole required detail.Though I have javascript validation on my registration page also have captcha.what should I do to prevent this type of illegal registration?

+6  A: 

Validate your data server-side. Client-side validation is great to help novice users, but you shouldn't trust it since it can be bypassed - server-side validation is a must to actually enforce proper values. A quick googling for "php form validation" turned up this example of the differences between client-side and server-side validation:

http://www.php-mysql-tutorial.com/wikis/php-tutorial/form-validation-using-php.aspx

Amber
+1  A: 

you can put javascript valuidation for each field, e.g. if all required, email valid etc. You can also use server side validation. A good approach would be using both of them for added security.

http://www.w3schools.com/jS/js_form_validation.asp

http://www.html-form-guide.com/php-form/php-form-validation.html

http://www.php-mysql-tutorial.com/wikis/php-tutorial/form-validation-using-php.aspx

Bhaskar
You say "tyou can also use server side validation" ; NO : you **must** use server-side validation, **always** ! JS validations are just so your form is more user-friendly, avoiding the waiting time that a client-server roundtrip implies in case of an error. Javascript can be disabed, form posting can be faked, ... **You must not rely on JS validations**, that are inherently not secure!
Pascal MARTIN