- Home /
Getting Value From Site
Hello Everybody
i have a Login System Code
WWWForm forum = new WWWForm();
forum.AddField("user",user);
forum.AddField("password",password);
WWW w = new WWW("http://MYLINK/login.php", forum);
StartCoroutine(login(w));
and the Registration
WWWForm forum = new WWWForm();
forum.AddField("user",user);
forum.AddField("name",name);
forum.AddField("password",password);
WWW w = new WWW("http://MYLINK/register.php", forum);
StartCoroutine(register(w));
everything works fine but there is something i want to know
How i can Get Value From Database To GUI People Can Register name I Want GUILabel To show The value "name" from the database
here is my PHP Login
<?PHP
$user = $_POST['user'];
$pass = $_POST['password'];
$con = mysql_connect("XX","XXX","XX") or ("Cannot connect!" . mysql_error());
if (!$con)
die('Could not connect: ' . mysql_error());
mysql_select_db("XX" , $con) or die ("could not load the database" . mysql_error());
$check = mysql_query("SELECT * FROM XX WHERE `user`='".$user."'");
$numrows = mysql_num_rows($check);
if ($numrows == 0)
{
die ("Username does not exist \n");
}
else
{
$pass = md5($pass);
while($row = mysql_fetch_assoc($check))
{
if ($pass == $row['pass'])
die("login-SUCCESS");
else
die("Password does not match \n");
}
}
?>
Comment