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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:11:58+00:00 2026-05-22T19:11:58+00:00

Simply said: How do I receive data from a PHP echo to display using

  • 0

Simply said: How do I receive data from a PHP echo to display using AJAX?

I have the ability to use JQuery; however, I don’t know if that would be right for the job or not. I simply have a form in HTML which the user may input information, but as they are entering data, I want to check for availability against a database. If the input checks and there’s no problem, I don’t want any text displayed, but if there’s a problem then I want to display an error. I currently have a sign-up form working with PHP and MySQL through a database, but I can’t get the errors to echo out without having a page refresh. Is there any way to show errors without refreshing?

HTML:

<form action="index.php" method="POST">
            <table>
                <tr>
                    <td colspan="3"><h1>New to the site?</h1></td>
                </tr>
                <tr>
                    <td><span class="login_text">Username:</span></td>
                    <td><input type="text" class="inputs" name="signup_username" value="<?php echo $username ?>"></td>
                </tr>
                <tr>
                    <td><span class="login_text">Password:</span></td>
                    <td><input type="password" class="inputs" name="signup_password"></td>
                </tr>
                <tr>
                    <td><span class="login_text">Password <span style="color: #666666;">(repeat)</span>:</span></td>
                    <td><input type="password" class="inputs" name="signup_passwordrepeat"></td>
                </tr>
                <tr>
                    <td><span class="login_text">Email:</span></td>
                    <td><input type="text" class="inputs" name="signup_email" value="<?php echo $email ?>"></td>
                </tr>
                <tr>
                    <td colspan="2"><input type="submit" id="signupbutton" class="subutton" style="font-family: Georgia, sans-serif;  font-size: 1.5em;  width: 265px;  height: 3em;" value="Sign Up!" name="signup_button"></td>
                </tr>
            </table>
        </form>

PHP:

<?php
            $submit = $_POST["signup_button"];
            $username = mysql_real_escape_string($_POST["signup_username"]);
            $password = mysql_real_escape_string($_POST["signup_password"]);
            $repeatpassword = mysql_real_escape_string($_POST["signup_passwordrepeat"]);
            $email = mysql_real_escape_string($_POST["signup_email"]);
            $date = date(m.d.y);

            if($submit) {  //If the form is submitted
                if($username && $password && $repeatpassword && $email) {  //If everything is filled out
                    //Check length of username
                    if(strlen($username) <= 16) {
                        $usercheck = mysql_query("SELECT * FROM artists WHERE username='$username'");
                        $usernum = mysql_num_rows($usercheck);

                        if($usernum == 0) {  //Check for availability of username
                            $emailcheck = mysql_query("SELECT * FROM artists WHERE email='$email'");
                            $emailnum = mysql_num_rows($emailcheck);

                            if($emailnum == 0) {  //Check for availability of email address
                                if($password == $repeatpassword) {  //Check for identical password input
                                    //Encrypt password
                                    $password = sha1($password);
                                    $repeatpassword = sha1($repeatpassword);

                                    //REGISTER
                                    $register = mysql_query("INSERT INTO artists VALUES ('', '', '$username', '$password', '$email', '', '$date')");
                                    echo("Registration successful, please log in on the right!");
                                }
                                else
                                    echo("The passwords don't match!");
                            }
                            else
                                echo("That email address has already been registered!");
                        }
                        else
                            echo("That username has already been registered!");
                    }
                    else
                        echo("The username you entered is too long!");
                }
                else
                    echo("Please fill out all fields!");
            }
        ?>
  • 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-22T19:11:58+00:00Added an answer on May 22, 2026 at 7:11 pm

    The jQuery validation plugin is the standard validation system for jQuery and provides support for AJAX based validation (where it sends things back to the server to validate it and displays a message for you if it fails).

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

Sidebar

Related Questions

Currently my GUI is Freezing when I try to display data I read from
I have been using Uploadify in my PHP application for the last couple months,
Possible Duplicate: I need a good way to get data from a thread to
I have two computers in geographically dispersed locations, both connected to the internet. On
We have a small daemon application written in C for a couple of various
I have images covering the whole of South Africa. These are in Tiff format
I have a very simple HTML layout where a vertical navigation bar should sit
I have created a project with a simple RDLC report in ASP.NET which when
I've implement simple udp server on my Android device.(sdk 1.5) it works fine when
I'm writing a client-server application to be used in a computer lab and act

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.