Php to Unity 3D

Hi friends,

first, Unity 4.3 Get better. Thank you for all employees.

I’m designing a membership system. Using php. Okay, register and login.

I want one. Someone entered. Information show. How can we do this?

That is,

1: Introduction did . < " Okey. "

2: Information show. < " Needs to be done. "

(Test) Using php;

	$userName = $_POST["myform_userName"];
	
	$yaz = mysql_fetch_array(mysql_query("select * from profil where username='$userName'"));
	
	$id = $yaz['id'];
	$username = $yaz['username'];
	$nick = $yaz['nick'];

Unity ;

public string userName= "";
form.AddField("myform_userName", userName);

User name entered.(Worked.) > How information will appear?

Waiting for help.

  • Thank You. And sorry, My english is a bit bad. :slight_smile:

Hi,

You need to use WWW class with WWForm to fetch data from server. There is a good tutorial here.

-ikel

Thank you for your answer. That’s right.

“WWW” is required. But, For example, It’s complicated.
It, very should not be difficult. Do not have an example or project to another? Nevertheless, I look into it.

I don’t think it’s complicated. The script example in the documentation for WWWForm shows how you can upload high scores to a website. I know the example on the server is written in perl and not PHP, but it’s a complete, working example that is close to what you want to do. See:

http://docs.unity3d.com/Documentation/ScriptReference/WWWForm.html

The problem is still the same. :frowning:

    $userName = $_POST["myform_userName"];

    $yaz = mysql_fetch_array(mysql_query("select * from profil where username='$userName'"));

    $id = $yaz['id'];
    $username = $yaz['username'];
    $nick = $yaz['nick'];

The lower part of the code “echo” added.

Sample : echo $id;

When it comes to Unity. Code : idPublic = w.data; > It works. Entered as the user name, the id appears.

but,

do php code : echo $id; echo $nick;

Unity, Outcome : the same information, seems unified .

Picture ;

1418529--74510--$Adsız.png

How can we show the other way?

when you echo try

echo $row[‘Name’] . “\n”;

to put each result on a new line.