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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:35:15+00:00 2026-06-11T14:35:15+00:00

I have a question regarding the php validation, I have this script $(document).ready(function(){ //

  • 0

I have a question regarding the php validation, I have this script

$(document).ready(function(){
// validate signup form on keyup and submit
var validator = $("#contactform").validate({
    rules: {
        email: {
            email: true,
            required: true,
            remote: { url: "test.php", type: "post" }
        }
    },
    messages: {
        email: {
            email: "Enter a valid email adress",
            required: "This input is required",
            remote: "Email adress is in use"
        }
    },
    // set this class to error-labels to indicate valid fields
    success: function(label) {
        label.addClass("checked");
    }
});
});

and the validation script from test.php is

define('__ROOT__', dirname(dirname(dirname(__FILE__)))); 
require_once (__ROOT__.'/config.php');

$email = mysql_real_escape_string($_POST['email']);
$SQL = $mysqli->query("SELECT * FROM users WHERE email='$email'");
    If($SQL->num_rows == 0) {
        echo 'true';
    } else {
        echo 'false';
    }

How can I make the validation from the php file to be more complex like: I want to add a rule to check if the email is valid ( just in case someone don’t have javascript active ) but if I try something like this the validation script wont return me an error message if the email address is in the database

If(filter_var($email, FILTER_VALIDATE_EMAIL) == false) {
$SQL = $mysqli->query("SELECT * FROM users WHERE email='$email'");
    If($SQL->num_rows == 0) {
        echo 'true';
    } else {
        echo '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-11T14:35:16+00:00Added an answer on June 11, 2026 at 2:35 pm

    There are some problems around the remote usage with jquery.validate. Check if you did the following:

    1) Make sure you are using jQuery version 1.6.1 and above only.

    2) Use the “synchronous” option for remote execution (default being asynchronous) and set async option to false.

    Usage:

    $("#contactform").validate({
      rules: {
        email: {
          required: true,
          email: true,
          remote: { url:"check.php", async:false }
        }
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question regarding static function in php. let's assume that I have
I have a simple question regarding PHP to check if this is the last
hello everybody i have a question regarding strip_tags function. i have an html document
I have a question regarding the proper way to modify a php DateTime object.
I have question regarding the use of function parameters. In the past I have
This question is regarding wordpress . I have two variables $random_n and $adcount declared
I have a question regarding PHP and it's memory limit. I have an index.php
I have a question regarding php and opening files PHP has more than one
I have a question regarding NULL in PHP: $a = ''; if($a == NULL)
I have a question regarding database connection in PHP and MySQL. I wonder if

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.