- Home /
WWWform on Unity Web Player vs Browsers
i'm using PHP and c# on Unity Web Player 5.0.0f4... so i have this...
...
WWWForm form = new WWWForm ();
form.AddField ("func", "login");
form.AddField ("username", l);
form.AddField ("password", s);
WWW webRequest = new WWW(URL_funcaomdan,form);
yield return webRequest;
...
and PHP:
$func = $_POST['func'];
This work fine on Opera, Chrome... but on IE and Firefox the PHP can't get the form field named "func".
obviously return on log "Notice: Undefined index: func in /home/xxx/public_html/xxx/unity_func.php"
know some fix?
no, using IE and Firefox i cant get username or password too... the unity Request the page, but cant send the fields =/
if unity are sending the browser are blocking this field for some security reason.
:S
IEnumerator checkLogin(string l, string s){
WWWForm form = new WWWForm ();
form.AddField ("func", "login");
form.AddField ("username", l);
form.AddField ("password", s);
WWW webRequest = new WWW(URL_funcao,form);
yield return webRequest;
if (webRequest.error != null) {
Debug.Log (webRequest.error);
} else {
Debug.Log (webRequest.text);}}
and then
StartCoroutine (checkLogin (usr_name,usr_password));
same bug other pages: http://issuetracker.unity3d.com/issues/www-post-request-on-webplayer-built-by-unity-5-dot-0-0f2-creates-an-invalid-request
http://issuetracker.unity3d.com/issues/www-forms-do-not-work-properly-in-webplayer-unity-5
http://answers.unity3d.com/questions/917515/unity5-webplayer-wwwform-problem.html
Your answer
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Multiple Cars not working 1 Answer
Help please guys thank you so much! 1 Answer
C# damage script help 1 Answer
Error with Hud C# script 1 Answer