Php code for validating registration form Adult phone role play
* * @param String $firstname * The users first name. * * @param String $address * Street and house number of the users residence.
* * @param String $postal_code * Swedish zip code of the users residence.
* On success an Array containing a success flag and the usertype as text.
*/ function validate_registration( $firstname, $lastname, $address, $postal_code, $city, $usertype, $email, $password, $confirmed_password ) Your current code catches DB-Errors in your validation function.
* * @param String $city * The city of the users residence.
* * @param String $usertype * The type of user, for example teacher. * * @param String $password * The users password in clear text.
Use a user object for your user which you initialize with an array and that you can revert back to an array to store it in the DB.
The labels are in Swedish but you can see the translation in the First the good news: You use prepared queries which is a good thing as it prevents SQLInjection one of the most nasty and common security breaches. But you should improve the following things: Add a CSRF token!!* * @param String $confirmed_password * The repeated input of the users password in clear text.