You shouldn't be adding restrict access to the login page that redirects them to the results page if they aren't logged in. If they aren't logged in they need to access the login page in order to log in.
Your success redirect on the registration page is set to:
"login.php?success=1";
That is making the login page automatically show the message that the user has successfully logged in even when they haven't.
You shouldn't delete those lines from insert, you should just update the redirect to "" like:
$WA_redirectURL = "";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";
But now it appears you have removed the login server behavior from the registration page, so maybe you should have a redirect after insert to the login page, but it should just be:
$WA_redirectURL = "login.php";
if (function_exists("rel2abs")) $WA_redirectURL = $WA_redirectURL?rel2abs($WA_redirectURL,dirname(__FILE__)):"";