Jump to content

Email address as username


Go to solution Solved by Nathan Explosion,

Recommended Posts

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.

 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...