$conn=mysql_connect($hostname, $username, $password) or die("ติดต่อเซฟเวอร์ไม่ได้");
mysql_select_db($dbname) or die("ติดต่อฐานข้อมูลไม่ได้");
mysql_query("SET NAME utf8")
?>
</body>
</html>
$check="select uname from user where uname='$user'";
$q=mysql_query($check);
$num=mysql_num_rows($q);
if($num==0){
$sql="insert into user values(null,'$user','$password1','$email','$ip'";
mysql_query($sql);
}else
exit("<script>alert('usernameซ้ำ');history.back();</script>");