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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:20:15+00:00 2026-05-16T03:20:15+00:00

I would like to send this textfield value to a php file using jQuery.

  • 0

I would like to send this textfield value to a php file using jQuery.

HTML code:

<div>
    <label for="email">Email: </label>
    <input type="text" id="email" name="email" />
    <span id="msgbox" class="msgbox"></span>
</div>

jQuery code:

$(document).ready(function()
{
    $("#email").blur(function()
    {
        $("#msgbox").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow");

        $.post("availability.php", { email: $(this).val() }, function(data)
        {
            if(data == 'yes')
            {
                $("#msgbox").fadeTo(200, 0.1, function()
                { 
                    $(this).html('Email Already exists').addClass('messageboxerror').fadeTo(900,1);
                });  
            }
            else
            {
                $("#msgbox").fadeTo(200, 0.1, function()
                { 
                    $(this).html('Email available to register').addClass('messageboxok').fadeTo(900,1); 
                });
            }
        });
    });
});

PHP code:

include_once $_SERVER['DOCUMENT_ROOT'] . '/braddclient/includes/magicquotes.inc.php';
include $_SERVER['DOCUMENT_ROOT'] . '/braddclient/includes/db.inc.php';

$email = mysqli_real_escape_string($link, $_POST['email']);

$sql = "SELECT * FROM bradduser WHERE email='$email'";
$result = mysqli_query($link, $sql);

if(!$result)
{
    $error = 'Error fetching email from bradduser.';
    include 'error.html.php';
    exit();
}

if(mysqli_num_rows($result) > 0)
{ 
    echo ‘yes’; //email already exist
} 
else 
{
    echo ‘no’;
}

The problem with the codes is that that doesn’t seem to be a communication between jquery and php. The data refused to be sent to php. Please help to see what’s wrong with the codes.

  • 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-16T03:20:16+00:00Added an answer on May 16, 2026 at 3:20 am

    echo ‘yes’; is not a valid sintax

    try:

    echo 'yes'; with single quote

    your jQuery scripting is ok but I think you have problems with availability.php

    • check if it is in same folder, if not, put a relative path to it
    • check your database connection
    • check if you have ' instead of ‘
    • try to access the availability.php with the arguments, and to test use $_REQUEST['email'] then switch back. (eg: http://www.example.org/availability.php?email=blabla@example.org)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 488k
  • Answers 488k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The first script block creates a script tag, which downloads… May 16, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer We have tried both Icefaces (in JSF 1.2 mode) and… May 16, 2026 at 8:43 am
  • Editorial Team
    Editorial Team added an answer The only technology I know of that can do this… May 16, 2026 at 8:43 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I would like to process a frame element in my source xml file using
How often do we see stuff like Send this page to a friend on
I'm building an application that gives users the option to send out an email
I would like to create a widget for use in Django Forms. There is
I would like to receive the input for my MATLAB program from an USB
How would I properly pass along data to a class being referenced in this
I'm using PHP version 5.3.2 on both my local development server and remote web
How can I send keyboard input messages to either the currently selected window or
I want to create a very simple HTML/AJAX based GUI for a Python program.
Does anyone know of a way to script flash objects using WatiN? I need

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.