How do I create a new user using code?

Discussion in 'Customization & add-ons' started by edusites, Aug 25, 2015.

  1. edusites

    edusites Member

    Joined:
    Aug 9, 2009
    Messages:
    54
    I have a form that collects a username, password, and email address, I also send product information on the form too, and I need to create a new user programmatically from this information, I can insert info into the various tables, but I do not know how to encrypt the password correctly.

    Is there an easy way to create a new user? Alternatively how do I encrypt the password?

    Many thanks for all your help.
  2. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    What handles the form?

    You can create new user from above information by submitting username, password and email address using the normal aMember method by posting this information to with 'action="/amember/signup" '. This will also encrypt password.
  3. edusites

    edusites Member

    Joined:
    Aug 9, 2009
    Messages:
    54
    I'm adjusting a form and custom code, originally written by another dev, the original code creates a user in ExpressionEngine, I've extended it to create a user in aMember too.

    Doesn't the normal aMember method require lots of other information, like Institution?
  4. edusites

    edusites Member

    Joined:
    Aug 9, 2009
    Messages:
    54
    Can it be done through the API?

Share This Page