- Home /
WWW and php issues
I'm getting "The type WWW' does not contain a constructor that takes
2' arguments" my code is :
using UnityEngine;
using System.Collections;
public class WWW : MonoBehaviour {
public string url = "http://..website../unity.php?";
public string Username;
public string Password;
public bool canLogin;
private WWW getdata;
void Start () {
}
void Update () {
}
void OnGUI(){
Username = GUI.TextField(new Rect(10,10,200,20),Username,25);
Password = GUI.PasswordField(new Rect(10,10,200,20),Password,"*"[0],25);
}
IEnumerator www(){
WWWForm form = new WWWForm();
form.AddField("Username",Username);
form.AddField("Password",Password);
getdata = new WWW(url, form);
yield return getdata;
}
}
it's unfinished but it's almost done anyways, its saying 'getdata = new WWW(url, form);' is the issue, but every thing iv'e looked at says that's okay, i also can use getdata.text, only .guitext, so anyone know where i messed up? it's probably obvious to someone, first time trying to access data from my site.
Unity already has a class called WWW
. Don't try and confuse the compiler. Call your class something unique.
Answer by joshpsawyer · Apr 27, 2014 at 04:30 PM
The problem is that you've also named your class WWW. You could clarify it by specifying the namespace of Unity's WWW, but using your WWW class will be problematic. Change your class name.