Get PHP variable into unity (Solved)

Hello everybody!
I’m using this in the webpage where is my webplayer embeeded

<param name="src" value="myfile.unity3d?u=<?php echo $user ?>" />

And in the Script this…

var usuario = "";

function Start (){
usuario = Application.srcValue;
}

function OnGUI(){
GUI.Label (Rect (0, 0, Screen.width, 25), "Hello "+Application.srcValue);
}

Supossing this $user var in PHP is the name of the user, “Jhon” at this example.
This result in

There is a way to get only the PHP var in Unity to get only?

Thanks for any help

You can either parse the srcValue and read the key/value pairs manually, or use some JavaScript browser communication:

http://unity3d.com/support/documentation/Manual/Unity%20Web%20Player%20and%20browser%20communication.html

The JavaScript communication may be the better bet; according to one person your browser may no longer cache the .Unity3D file if you append it with the ?key=value sets.

because i really dont know how to do that

I tried the example in the documentation but it makes an error… how can i call the function with the (param : String)?

Ok, then use the methods on the String class to parse your variables:

You’ll probably want to use Index, Substring, and Split.

my problem is how to call that function… i don’t know if i have to put a call (and how to) in the webpage or put it into Script (and how to)

Solved, i show the way:

user2= user.Substring(18, user.Length - 18);