Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
A very quick search using a chunk of your question as the search term gave 181 million hits - and that is without adding PHP to the mix. The first hit, is PHP and registration form related:
http://www.html-form-guide.com/php-form/php-registration-form.html[
^]
In future, please try to do at least basic research yourself, and not waste your time or ours.