Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › Post-registration redirect
Tagged: automatic login redirect
- This topic has 27 replies, 11 voices, and was last updated 10 years, 3 months ago by wzp.
-
AuthorPosts
-
March 31, 2010 at 1:23 pm #1005GraphicBassMember
I’ve created a registration page that displays if a visit attempts to access protected content with the registration shortcode.
It works well, but remains on the same page, with the same “please register” message, after a successful registration.
Is there a way to re-direct the visitor to a page when registration is complete (a “successful registration” page) rather than remain on the same page?
Thanks!
gary
April 1, 2010 at 7:05 am #19290amin007ParticipantAfter a successful registration the registration form will disappear telling you that the registration was successful and it will show a link for the login page. Is this not happening? if not please post the eMember version you are using.
April 1, 2010 at 9:54 pm #19291GraphicBassMemberActually, that is what is happening, so it’s working correctly. It a small line under my headline with the success message and log-in link.
I’d like to do is a re-direct to a log-in page instead of just displaying the message on the “same” page, so visitors/members are not confused by the headline and miss the small type (which I know I can make larger using CSS, but would still rather have a separate page).
Thanks!
gary
April 2, 2010 at 3:11 am #19292amin007ParticipantYou can tweak the code to achieve what you want. This is what you will have to do…
1) Open the “eMember_misc_functions.php” file.
2) Search for the following bit of code in that file:
$redirect_page = $emember_config->getValue('login_page_url');
if (!empty($redirect_page)) $output .= EMEMBER_PLEASE.' <a href="'.$redirect_page.'">'.EMEMBER_LOGIN.'</a>';3) Once you find it then change it with the following code:
$redirect_page = $emember_config->getValue('login_page_url');
header("Location: ".$redirect_page);
exit;April 2, 2010 at 5:08 am #19293GraphicBassMemberThanks very much!
gary
December 31, 2010 at 9:42 am #19294sgrpublishingMemberHi Just found this post as I wanted to implement the same thing as Gary did however, after finding the code and replacing it all I get is this error message:
Fatal error: Call to a member function getValue() on a non-object in /home/mikeruffles/theprimarysecret.com/wp-content/plugins/wp-eMember/eMember_misc_functions.php on line 412
Perhaps you can help and tell me where I am going wrong.
Thanks
Mike
January 1, 2011 at 2:34 am #19295amin007ParticipantWhat version of eMember are you using?
January 1, 2011 at 9:29 am #19296sgrpublishingMemberThis from the Dashboard
WP eMembers – Dashboard v5.9.8
January 2, 2011 at 3:10 am #19297amin007ParticipantTry
$emember_config
instead of$config
I have updated the code example above.
January 2, 2011 at 9:04 am #19298sgrpublishingMemberTried that but now getting this error:
Warning: Cannot modify header information – headers already sent by (output started at /home/mikeruffles/theprimarysecret.com/wp-content/plugins/wp-eMember/emember_password_sender_box.php:13) in /home/mikeruffles/theprimarysecret.com/wp-content/plugins/wp-eMember/eMember_misc_functions.php on line 413
January 2, 2011 at 1:22 pm #19299amin007ParticipantWhen you modified the file did you introduce spaces in the .php file? That is one reason for this kind of the error. What editor do you use to modify the .php files?
January 3, 2011 at 12:49 pm #19300sgrpublishingMemberI used the wordpress built in plugin editor, selecting the eMember_misc_functions.php file, then searching for the code:
$redirect_page = $emember_config->getValue(‘login_page_url’);
if (!empty($redirect_page)) $output .= EMEMBER_PLEASE.’ ‘.EMEMBER_LOGIN.’‘;
And then replacing it with this one.
$redirect_page = $emember_config->getValue(‘login_page_url’);
header(“Location: “.$redirect_page);
exit;
That’s all, sfter saving the file the error comes up when I fill in the registration form and press Register.
By the way the newly registerd members are not passed to my Getresponse autoresponder account as well but I opened a new thread on this a couple of days ago.
January 4, 2011 at 4:39 am #19301amin007ParticipantI will send you an email to get site access so I can check this out.
February 3, 2011 at 7:07 am #19302bdeshazerMemberfyi, I wanted this functionality too and ran into the same header problem, so I just tried the following two solutions and both seemed to work:
$redirect_page = $emember_config->getValue(‘login_page_url’);
if (!empty($redirect_page)) echo ‘<script language=”Javascript”>window.location=”‘.$redirect_page.'”;</script>’;
and
$redirect_page = $emember_config->getValue(‘login_page_url’);
if (!empty($redirect_page)) echo ‘<META HTTP-EQUIV=”Refresh” Content=”0; URL=’.$redirect_page.'”>’;
I’m sticking with the javascript solution for now.
Brent
June 6, 2011 at 10:11 am #19303frantanMemberHi,
I would like to automatically redirect people after they have registered to a welcome message page rather than the generic login page. How would I modify the code to do this please?
Many Thanks
-
AuthorPosts
- You must be logged in to reply to this topic.