<?php
include '../../includes/configuration.php';


//query the users table for availabilty
$q = "SELECT email FROM users";
$r = mysql_query($q);

if($r)
{
	$existing_email = array();
	while($row = mysql_fetch_array($r, MYSQL_ASSOC))
	{
		
		$existing_emails[] = $row['email'];
		
		
	}
	
}

// email availability
//this varible contains the array of existing users
//$existing_emails=array('roshan','mike','jason'); 
//value got from the get metho
$email=$_POST['email'];
//checking weather user exists or not in $existing_users array
if (in_array($email, $existing_emails))
{
	//user name is not availble
	echo "no";
} 
else
{
	//user name is available
	echo "yes";
}
?>