forgot password?
need an account?

Notifications close x

signup_success problem fix

loading social widgets...
LewisAndersonWritten By: LewisAnderson   flag
Publish Date: December 14, 2014
There have been numerous people having trouble with the signup_success message when a user signs up. Instead of users getting the correct message of... OK user, check your email inbox and junk mail box at your email in a moment to complete the sign up process by activating your account. You will not be able to do anything on the site until you successfully activate your account. they are just getting... signup_success Here is the problem The problem is a white space issue in your php processing code. White space can be caused by.... -blank lines preceding the opening <?php in your code -trailing characters / lines after the closing ?> Here is the fix -- This is the ideal fix.... if you remove the offending whitespace/commented out code....you remove the problem at it's source rather than adding extra processing at the user level to get the same result. You can go over your PHP code to make sure to remove all offending lines pointed out above, or you can edit your ajax return to remove them through code.
If you would rather not use the above method.... If you want to remove them in the ajax, here is how you can do that. Find this chunk of code inside the function signup() -- on signup.php
if(ajaxReturn(ajax) == true) { if(ajax.responseText != "signup_success"){ status.innerHTML = ajax.responseText; _("signupbtn").style.display = "block"; } else { window.scrollTo(0,0); _("signupform").innerHTML = "OK "+u+", check your email inbox and junk mail box at <u>"+e+"</u> in a moment to complete the sign up process by activating your account. You will not be able to do anything on the site until you successfully activate your account."; } }
And replace that chunk with this..... ***important....see note below this code also
if(ajaxReturn(ajax) == true) { var returnString = ajax.responseText; returnString = returnString.replace(/(rn|n|r)/gm,""); if(returnString != "signup_success"){ status.innerHTML = returnString; _("signupbtn").style.display = "block"; } else { window.scrollTo(0,0); _("signupform").innerHTML = "OK "+u+", check your email inbox and junk mail box at <u>"+e+"</u> in a moment to complete the sign up process by activating your account. You will not be able to do anything on the site until you successfully activate your account."; } }
***Note about above code This code editor removes certain characters... This line right here had backslashes originally but were stripped by the code editor..
returnString = returnString.replace(/(rn|n|r)/gm,"");
so put the backslashes in where I have BS.
returnString = returnString.replace(/(BSrBSn|BSn|BSr)/gm,"");
What we changed that code to do is this..... var returnString will hold the value that is returned. Then we remove new line characters. Then we check if that value is signup_success.....and do the appropriate process.
You can read more articles by LewisAnderson by clicking this link:
Articles written by LewisAnderson

User Notes And Comments ↓

Sunday December 14, 2014 07:46:36 AM
LewisAnderson said:to anyone using the javascript method to remove new line characters, make sure you add backslashes where I noted....and it is 1 backslash per BS...no spaces
Monday December 15, 2014 03:13:58 PM
promiselxg said:thanks lewis, i appreciate your good work here in wi
Tuesday December 15, 2015 04:01:58 AM
BOER said:I managed to fix all my issues with the .trim() method (for anyone interested. Example: if(ajax.responseText.trim() != "signup_success")
Tuesday December 15, 2015 04:39:55 AM
LewisAnderson said:@BOER - Sure you can do that for a fix also. Ideally though, the absolute best fix is to go into the php code and remove the whitespace and commented out stuff that way you don't add extra processing....but whatever works.
Tuesday December 15, 2015 05:20:35 PM
BOER said:@Lewis - Yes that's the best way -agreed. I just managed to find that solution going through the forums here, and have never seen your article. I think I'll take on your approach, seems safer as well :) Thanks for the solution!
© 2015 webintersect.com
There is a top-shelf free educational course of videos associated with this domain, all about how to build custom communities and social network websites. There are over 45 videos in the course totaling just over 10 hours. We also archived the deprecated course material here for you to reference on the source files page.