Answer the question
In order to leave comments, you need to log in
Unity3D + PHP interaction?
Good evening, I don’t understand why it gives out 400 Bad Request .... with this code in the unit:
#pragma strict
var id = "";
function Connect(){
var form = new WWWForm();
form.AddField('id' , 'id');
var download = new WWW('http://test/user', form);
yield download;
if(download.error){
print('error downloading:' + download.error);
return;
}else{
Debug.Log(download.text);
}
}
function OnGUI(){
//Создаём текстовое поле для id
id = GUI.TextField(new Rect(Screen.width/2-100, Screen.height/2-100, 200, 20), id, 12);
if (GUI.Button(new Rect(Screen.width/2-100, Screen.height/2-25, 200, 20), "Connect"))
{
Connect();
}
}
echo $_REQUEST['id'];
Answer the question
In order to leave comments, you need to log in
It seems to me that the matter is that you do not have a host in the URl. It would be host1.dev/test then the action index in the TestController would be called back.
https://ru.wikipedia.org/wiki/%D0%A1%D0%BF%D0%B8%D...
Check what new WWW generates there (I think you can sniff traffic using Fiddler2).
Guys, who will tell? there is a file written in unity3d
there is an html file with it in the kit, if you run the html file in the browser, then everything is displayed normally. But I have a site in php, and I want to link it to one of the tabs on the site (there is a mini-game), who can tell me how to do it? I've already broken my whole head, whatever one may say, the unity player shows a white screen and error messages .... How to fix it?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question