<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

</head>
<body>
<?php
	include('conn.php');
	$sql = "select * from members where user ='".$_POST['user']."'";
	$result = mysql_query($sql);
	while ($data = mysql_fetch_array($result))
	{	
		//echo $data['user'];
		if($data['user']==$_POST['user']){
			$user = "no";
		}
	}
	if($_POST['user']!=""){
		if($user=="no"){
			echo"<font color=\"#FF0000\"> ไม่สามารถใช้ Username ได้</form>";
			
		}else{
			echo"<font color=\"#00FF00\"> สามารถใช้ Username ได้</form>";
		}
	}else{
		echo"*กรุณากรอกข้อมูล";
		
	}
?>
</body>
</html>