Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9096443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:51:13+00:00 2026-06-16T23:51:13+00:00

I have created a login form on a wordpress website that will give users

  • 0

I have created a login form on a wordpress website that will give users access to members only content. I have three functions login() resetPassword() and register().

Both the login() and resetPassword() forms worked perfectly until I added the third function register() and then none of the forms will submit at all.

If I delete the register() function then the other forms start working again. Also if I place the other functions in their own <script> tag then they work as expected, but the register() function still doesn’t function properly.

I have looked over the code again and again, and tried placing it in different areas… I’m not sure what is causing the problem. Has anyone had this happen before? How do I fix it?

<script type="text/javascript">
function login()
{
    var email = document.getElementById("LoginUName").value;
    var pword = document.getElementById("LoginPWord").value;
    var xmlhttp;
    if (window.XMLHttpRequest)xmlhttp=new XMLHttpRequest(); 
    else xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
    xmlhttp.onreadystatechange=function(){document.getElementById('LoginScreen').innerHTML=xmlhttp.responseText;}
    xmlhttp.open('GET','login.php?EMail='+email+'&PWord='+pword,true);
    xmlhttp.send();
}
function resetPassword()
{
    var email = document.getElementById("ResetEMail").value;
    var xmlhttp;
    if (window.XMLHttpRequest)xmlhttp=new XMLHttpRequest(); 
    else xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
    xmlhttp.onreadystatechange=function(){document.getElementById('LoginScreen').innerHTML=xmlhttp.responseText;}
    xmlhttp.open('GET','passwordReset.php?EMail='+email,true);
    xmlhttp.send();
}
function register()
{
    var firstname = document.getElementById("RegisterFirstName").value;
    var lastname = document.getElementById("RegisterLastName").value;
    var email = document.getElementById("RegisterEMail").value;
    var pword = document.getElementById("RegisterPWord").value;
    var xmlhttp;
    if (window.XMLHttpRequest)xmlhttp=new XMLHttpRequest(); 
    else xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
    xmlhttp.onreadystatechange=function(){document.getElementById('LoginScreen').innerHTML=xmlhttp.responseText;}
    xmlhttp.open('GET','register.php?FirstName='+firstname+'&LastName='+lastname+'&EMail='+email'&PWord='+pword,true);
    xmlhttp.send();
}
</script>


<div id="LoginScreen">
<h1>Welcome to ****.</h1><br>
<h2>Please login or register below:</h2><br>
<form action="javascript: login()" method="get">
    <ul>
        <li>
            <h3>Username:&nbsp;</h3><input type="email" id="LoginUName" name="LoginUName" placeholder="Email address" />
        </li>
        <li>
            <h3>Password:&nbsp;</h3><input type="password" id="LoginPWord" name="LoginPWord" placeholder="Password"/>
        </li>
    </ul>
    <input type="submit" value="Login"/>
</form>
<br><hr><br>
<form action="javascript: resetPassword()" method="get">
    <h2>Forgot your password?</h2><br>
    Email address:&nbsp;<input type="email" id="ResetEMail" name="ResetEMail" placeholder="Email address" />&nbsp;&nbsp;<input type="submit" value="Reset" />
</form>
<br><hr><br>
<form action="javascript: register()" method="get">
    <h2>Register new user:</h2><br>
    <ul>
        <li>
            <h3>First Name:&nbsp;</h3><input type="text" id="RegisterFirstName" name="RegisterFirstName" placeholder="First Name" />
        </li>
        <li>
            <h3>Last Name:&nbsp;</h3><input type="text" id="RegisterLastName" name="RegisterLastName" placeholder="Last Name" />
        </li>
        <li>
            <h3>Email:&nbsp;</h3><input type="email" id="RegisterEMail" name="RegisterEMail" placeholder="email address" />
        </li>
        <li>
            <h3>Password:&nbsp;</h3><input type="password" id="RegisterPWord" name="RegisterPWord" placeholder="Password" />
        </li>
    </ul>
    <input type="submit" value="Register"/>
</form>

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:51:15+00:00Added an answer on June 16, 2026 at 11:51 pm

    It’s just a syntax error. You missed a + sign.

    You have:

        xmlhttp.open('GET','register.php?FirstName='+firstname+'&LastName='+lastname+'&EMail='+email'&PWord='+pword,true);
    

    It needs to have an + sign after email:

    xmlhttp.open('GET','register.php?FirstName='+firstname+'&LastName='+lastname+'&EMail='+email+'&PWord='+pword,true);
    

    That’s why it works if you put it in two separate scripts. One syntax error renders the whole script invalid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created Login forms and registration forms for a website. The form is
I have a website created in .NET where users are required to register/login to
I have the following interesting problem. I've created a secondary login form. From that
I have created a login form that works, so the next step is to
I have created a wordpress template and added a login form to in via
I have a login form in a website which I have created.I have used
I have created a login form for my website but currently, it is not
i have created one login and register view in that view after login user
I have created a User called Student and Teacher that can login into the
i have created a forum using php/mysql and users login through facebook using php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.