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 8854725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:56:59+00:00 2026-06-14T13:56:59+00:00

I am using PHP Login Script in COdeigniter programmed. If i am putting the

  • 0

I am using PHP Login Script in COdeigniter programmed. If i am putting the right credentials in this form, its show an error, while after putting the right credentials, if i opened the same form in new tab, its get opened automatically. seems, some js issues. any idea ? here is the code

 <form method="post" action="#" onsubmit="return validateLogin('loginForm')" name="loginForm"> 
          <table width="100%" cellpadding=0 cellspacing=0>
            <tr>
              <td>
                <b>
                  Username:
                </b> 
              </td>
              <td>
                <input type="text" name="usr" />
              </td>
            </tr>
            <tr>
              <td>
                <b>
                  Password:
                </b>
              </td>
              <td>
                <input type="password" name="pwd" />
              </td>
            </tr>
            <tr>
              <td></td>
              <td>
                <input type="submit" value="Login" class="submit" />
              </td>
            </tr>
          </table>  
        </form>

Functions is

function validateLogin(form) {
  user = document.forms[form].usr;
  pwd = document.forms[form].pwd;
  if(user.value.length==0)
  {
    notify('Please enter a valid username', 'error');
    user.focus();
    hilit('[name = user]');
    return false;
  }
  else if(pwd.value.length==0)
  {
    notify('Please enter a valid password', 'error');
    pwd.focus();
    hilit('[name = pwd]');
    return false;
  }
  else
  {
  notify('processing.... please wait', 'notice');
  dataString = 'user='+user.value+'&pwd='+pwd.value;
    jQuery.ajax({
      type: "POST",
      data: dataString,
      url: baseurl+'admin/checkLogin', 
      cache: false,
      error: function()
      {
        notify("An error occurd... please try later", 'error');
      },
      success: function(html)
      {
        if(html == 1)
        {
          window.location = baseurl+'admin/home';
        }
        else
        {
          notify('Your login details are incorrect!!!', 'error');
        }
      }
    });
    return false;
  }
  return false;
}
  • 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-14T13:57:00+00:00Added an answer on June 14, 2026 at 1:57 pm

    You are sending the data in a wrong way
    The data sent to server must be in key/value pairs. {key : value}

    modify your data in ajax call like this

    data : { user : user.value, pwd : pwd.value}
    

    EDIT

    Change your error handling code with this

    error:function(xhr,err){
        alert("readyState: "+xhr.readyState+"\nstatus: "+xhr.status);
        alert("responseText: "+xhr.responseText);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have this login php script that I am using and it works
I am using my admin panel login script where i have created a global.php
I am using a PHP login script that challenges user for username & password.
Using Codeigniter, I am trying to get a php script to run after a
I am using PHP to build a very basic login script . However, the
I'm creating a login script for a website i'm developing, and am using PHP
I have a login script using PHP. The variables for login in and out
I have this login script, but for some reason its not working. I checked
I have this php statement in my login script... else if ($_POST['email'] === $details['email']
I've got a really simple login script using PHP's sessions to limit access, but

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.