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

  • Home
  • SEARCH
  • 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 5944475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:32:32+00:00 2026-05-22T16:32:32+00:00

Not a question I want to ask but I really need another pair of

  • 0

Not a question I want to ask but I really need another pair of eyes on this one as it must be something silly I am missing.

I have used this same script previously so I’ve no idea what’s going wrong.

This is the frnt end code: http://jsfiddle.net/fU3Q3/1/

And the backend PHP is:

<?php 
require("../db.php");

// get the posted values
$email=$_POST['email'];
$password=$_POST['password'];

// now validating the username and password
$sql="SELECT * FROM admin WHERE email='".$email."'";
$result=mysql_query($sql) or die ("No such username exists!");
$row=mysql_fetch_array($result);

// if username exists
if(mysql_num_rows($result)>0)
{
// compare the password
if(strcmp($row['password'],$password)==0)
{
    echo "yes";
    // set the session from here
    $_SESSION['email']=$email; 
}
else
    echo "no"; 
}
else
echo "no"; // invalid Login
?>

Using firebug, the url that is sent to ajax-login.php seems to be email=&password=&rand=0.636999888626322 where obviously the bit on the end is the random number.

Any help is much appreciated.

Martin

  • 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-05-22T16:32:32+00:00Added an answer on May 22, 2026 at 4:32 pm
    $.post("ajax-login.php",{ email:$("input#email").val(),password:$("input#password").val
    (),rand:Math.random() } ,function(data)
    

    you have 2 id’s of the same type, a div id of email, a input id of email for example, you can not call #email as it will stop at the first occurance

    For further explanation… id’s without associated class names are considered unique, only 1 id can be used however if you have:

    <div class='content' id='email'>
    <input class='content' id='email'>
    

    you can call these in jquery by using following examples:

    formal declaration, type > classname ‘.’ > id ‘#’

    $("div.content#email");
    $("input.content#email");
    

    and this will not work without matching the first tag

    $(".content#email");
    $(".content#email");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not even sure how to ask this question. I want something that
I just want to clarify one thing. This is not a question on which
Sorry if this is not a programming question, but I'm not really sure where
Ok. This is probably a really stupid question, but I'm going to ask it
I'm not really sure how to ask this question. Suppose I have a class
Not entirely sure my question title describes what I want to do, but couldn't
Similar question , but for Oracle. Why would I not always want to choose
This is a question not really about programming (is not specific to any language
This is going to be a really dumb question, I just know it, but
This is a complete noob question, but I gotta ask it anyway I started

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.