Jump to content

Register Member Script


John 3:16
 Share

Recommended Posts

Does anyone have a script they are using to register a user outside of the /forum folder.  I have a php registration form I would like to use outside of the forum as it matches the rest of my main site.  I know there is a lot of checks and balances that go into registering a new member.  So anyway code I can drop into a php page to create a new member registration.

This code is from bfarber and it works but wanting to do checks to see if the username exists and then automatically login them in, any code samples would be extremely helpful?

<?php
require 'init.php';
$member = new \IPS\Member;
$member->name = $memberName;
$member->email = $memberEmail;
$member->ip_address	= \IPS\Request::i()->ipAddress();
$member->member_group_id = 3; // Put in the group ID you want to use
$member->allow_admin_mails = 1;
$member->joined = time();
$member->members_pass_salt = $member->generateSalt();
$member->members_pass_hash = $member->encryptedPassword( $memberPassword );
$member->save();

I have searched up and down for a solution but figured if any of you devsmasters know you could possibly let me know :)

Edited by John 3:16
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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