Jump to content

Featured Replies

Posted

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);

Could contain: Page, Text

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.

 

Solved by Nathan Explosion

Go to solution
  • Solution

Take a look at \IPS\Login::usernameIsInUse (system\login\login.php)

  • Author

Works great. Thanks.

Edited by SeNioR-

Recently Browsing 0

  • No registered users viewing this page.