SeNioR- Posted January 18, 2023 Posted January 18, 2023 Hi Guys. On many websites, when registering an account, there are only two fields, e-mail address and password. The username is set based on the email address, usually in its entirety or set based on what comes before the @ symbol e.g. emial: olivia.johnson@coldmail.com Username: Olivia.johnson My primitive working code looks like this: $GetNameEmail = substr($values['email_address'], 0, strrpos($values['email_address'], '@')); $member->name = ucfirst($GetNameEmail); I need to check if username is already in the database. How can I achieve it? Something like when registering via the social media method where if the nick is taken, we have to enter a different one. ArashDev 1
Solution Nathan Explosion Posted January 18, 2023 Solution Posted January 18, 2023 Take a look at \IPS\Login::usernameIsInUse (system\login\login.php) SeNioR- 1
SeNioR- Posted January 19, 2023 Author Posted January 19, 2023 (edited) Works great. Thanks. Edited January 19, 2023 by SeNioR-
Recommended Posts