Example #1
0
    IEnumerator GetProfileFromDB(string guideName)
    {
        string url        = "http://xavieriscool.web44.net/getProfile.php?" + "name=" + WWW.EscapeURL(guideName.Trim());
        WWW    getProfile = new WWW(url);

        yield return(getProfile);

        if (getProfile.error != null)
        {
            Debug.LogError("Error: " + getProfile.error);
        }
        else
        {
            string[] guides = getProfile.text.Substring(0, getProfile.text.LastIndexOf('%') - 1).Split('=');
            profileEmail.text = "Email: " + guides [0].Trim();
            profilePhone.text = "Phone #: " + guides [1].Trim();
            profileBlurb.text = guides [2].Trim();
            id = guides [3].Trim();
            string name = guideName;
            if (name.Contains("Xavier"))
            {
                FBScript.GetFBProfilPic(s[0]);
            }
            else if (name.Contains("Jimmy"))
            {
                FBScript.GetFBProfilPic(s[1]);
            }
            else if (name.Contains("Lizzy"))
            {
                FBScript.GetFBProfilPic(s[2]);
            }
            else
            {
                FBScript.GetFBProfilPic(s[3]);
            }
        }
    }