Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Remote validation with jQuery validate plugin
rules: {
email: {
required: true,
email: true,
remote: "verifica_email.php"
messages: {
email: {
remote: "Este email já está cadastrado."
require_once "config.php";
$email = mysql_real_escape_string($_GET["email"]);
$sql = "SELECT * FROM leads WHERE email = '$email'";
$query = mysql_query($sql);
if(mysql_num_rows($query) > 0) {
echo "false";
} else {
echo "true";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.