<?
if(isset($_REQUEST['username']) && ($_REQUEST['username']) && (strlen($_REQUEST['username']) > 5)){
	
	require_once "include/dbconnect.php";
	
	$sql = "select uid from users where username = '".$_REQUEST['username']."' limit 0,1";
	$results = mysql_query($sql) or die(mysql_error());
	$numrow = mysql_num_rows($results);
	if($numrow){
		echo "<font style='color:red'>Username already taken!</font>";
	}else{
		echo "<font style='color:green'>Username available</font>";
	}
}else{
	echo "<font style='color:red'>Please enter valid charachters.</font>";
}
?>