use javascript to check the format, e.g. email format, password length, etc.
use php to check for db if the same entry exists, e.g. same username
besides hackers, 99% ppl enable javascript, so just throw this problem.
here I recommend the jquery validation plugin for client-side validation.
source share