Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

function to register a new member


Go to End


3 Posts   1947 Views

Avatar
bebabeba

Community Member, 193 Posts

3 December 2008 at 12:21am

Hi!
I create a section to register user. Who is register can post comment about a particular published book.
I do my form to register member, I tahe form value and I ceck if in my db user with the same name and password exixts. Now how can do to allow user to post?An remeber that the user is registre?I try look on forum module but something is not clear for me and I can't please help me..

Avatar
g

Community Member, 22 Posts

3 December 2008 at 6:17am

If you mean login after registering try this:

$member_login = new MemberLoginForm();

if($member_login->performLogin($data))
{
// Redirect to the post page
Director::redirect('post-page/');
}

Avatar
bebabeba

Community Member, 193 Posts

3 December 2008 at 8:59pm

Thanks!
but I have an other problem. When I try to log a user seems forgot session. so I use:
$_SESSION["utente"] = $data['nome'];
$_SESSION["id"] = session_id();
in login function to remember user session. and I pass this varable in template but something is wrong..