<?
$table = "";
include ("");
$con = mysql_connect($host,$user,$pw) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");
$action = $_GET["action"];
switch ($action)
{
Case "GetUserName":
$username = $_GET["username"];
$q = mysql_query("SELECT password FROM $table WHERE username='$username'");
$rows = array();
while($r = mysql_fetch_assoc($q))
{
$rows[] = $r;
}
print json_encode($rows);
break;
case "SignUp":
$username = $_GET["username"];
$password = $_GET["password"];
$q = mysql_query("INSERT INTO $table (username, password) VALUES ('$username', '$password')");
print "Inserted";
break;
}
?>