PHP Code to provide user registration validation using MySQL and LDAP