Why is get_url adding an extra 'http://'? -- DB request fail

I used the Server Side Highscore code I found on the Wiki and added my own customized IEnumerator:

public string userScoreURL = "http://xxxxx.com/displayUser.php?";
	IEnumerator GetUserScore(string username)
	{
		Debug.Log ("Loading scores");
		string get_url = userScoreURL + "user=" + WWW.EscapeURL(username);
		Debug.Log (get_url); // Used to see what URL it's trying to pass
		
		WWW hs_get = new WWW(get_url);
		yield return hs_get;
		
		if(hs_get.error != null)
		{
			print("There was an error getting your score: " + hs_get.error);
		}
		else
		{
			Debug.Log(username + " : " + hs_get.text);
		}
		
	}

This is the way I’m using it (bare with me, I’m not an expert):

  • I created a public method which contains a Subroutine calling the IEnumerator:

    public void GetUserScoreCoRoutine(string username)
    {
    StartCoroutine(GetUserScore(username));
    }

  • From a different script I’m passing the username I’m trying the score for:

    public HSController HSScript;

     // Use this for initialization
     void Start () {
     	HSScript = GetComponent<HSController>();
     	HSScript.GetUserScoreCoRoutine("Tim"); //Tim needs to be replaced by playerPref later on
     }
    

So this fails and the I can see from my debug log that the URL passed looks like this:
http://http://xxxxx.com/displayUser.php?user=Tim
UnityEngine.Debug:Log(Object)
c__Iterator2:MoveNext() (at Assets/Script/HSController.cs:89)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
HSController:GetUserScoreCoRoutine(String) (at Assets/Script/HSController.cs:35)
DisplayUserScore:Start() (at Assets/Script/DisplayUserScore.cs:11)

Why does it have 2 x http? Is is the reason it’s failing? If I test the URL straight in the browser I get the high score correctly so my PHP scrips and DB are working fine.

Thanks for the help.

Oh I just figured it out… since my URLs are public variables, they are editable from the Inspector and the double http:// came from there. Apparently, inspector value > script value. Today I learned.