WWWform error 404 (php loads in browser but unity cannot find it.)

ok so when I open my URL is opened in my browser i am getting:

Warning: mysql_connect(): Connection timed out
Connected successfullyinsert into Users values (NULL, ‘Array’, ‘Array’ ‘Array’);

tho in unity I am getting this:
error 404 The requested URL was not found on this server.
(WWW) in the link doesn’t also seem to make a difrance

the link I am using is the same as the one in my browser.
I’ve spent the last 2 days trying to find an answer no threads i have found have presented an answer,
they all just go round in circles without explaining whats going on.
i don’t get why i am getting 404 when it loads in my browser.

using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class LoginRegister : MonoBehaviour {

	public string UserLoginURL = "http://mysite.com/login.php";
	public string UserRegiesterURL = "http://mysite.com/register.php";
	public string Username = "";
	public string Pass = "";
	public string Email = "";

	//fetched from mysql
	public Text XPText;
	public Image XPbar;
	public Text GoldText;
	public Text LevelText;
	public Text UsernameText;
	public Text RankText;
	public Text Recorcess;

	//setactive when loggedin
	public GameObject Logedin;
	public GameObject Logedout;
	public GameObject AccountSucsess;

	//input by player
	public Text InputUsername;
	public Text InputPassword;
	public Text InputEmail;


	//------------------------------------------------------------------------------------

	public void Loggin()
	{
		Username = InputUsername.text;
		Pass = InputPassword.text;
		Debug.Log ("" + Username + Pass + Email); // make sure string is acualy their.
		StartCoroutine(LoginUser(Username, Pass));
	}

	//------------------------------------------------------------------------------------


	public void Register()
	{
		Username = InputUsername.text;
		Pass = InputPassword.text;
		Email = InputEmail.text;
		StartCoroutine(RegisterUser(Username, Pass, Email));
		Debug.Log ("" + Username + Pass + Email); // make sure string is acualy their.


	}

	//------------------------------------------------------------------------------------

	IEnumerator LoginUser(string User, string Pass ) {
		WWW Login = new WWW (UserLoginURL + "Username" + Username + "Pass" + Pass + "Email" + Email);
		yield return Login;
		if (Login.error == null) {
			// display resaults:		???
			string[] splits = Login.text.Split (new char[]{ '>' });
			UsernameText.text = splits [0];
			GoldText.text = splits [1];
			XPText.text = splits [2];
			LevelText.text = splits [3];
			Recorcess.text = splits [4];
			RankText.text = splits [5];
			Logedout.SetActive (false);
			Logedin.SetActive (true);
		} else {
			Debug.Log ("" + Login.text); // show me the echo
		}
	}

	//------------------------------------------------------------------------------------


	IEnumerator RegisterUser(string User, string Pass, string Email ) {
		WWW Register = new WWW (UserRegiesterURL + "Username" + Username + "Pass" + Pass + "Email" + Email);
		yield return Register;
		if (Register.error == null) {
			AccountSucsess.SetActive (true);
			Debug.Log ("account Created" + Register.text); // show me the echo

		} else {
			Debug.Log ("Error" + Register.text); // show me the echo

		}
	}

} // END OF CLASS 	//--------------------------------------------------------------------

Well, the reason is pretty obvious. The error is in those two lines:

WWW Login = new WWW (UserLoginURL + "Username" + Username + "Pass" + Pass + "Email" + Email);

and

WWW Register = new WWW (UserRegiesterURL + "Username" + Username + "Pass" + Pass + "Email" + Email);

Lets assume a user name of "Paul", a password of "1234" and an email "sample@url.com"

So your login URL would look like this:

"http://mysite.com/login.phpUsernamePaulPass1234Emailsample@url.com"

This makes no sense. If you want to pass “GET” parameters to a website you have to create a valid URL. It probably should look like this:

"http://mysite.com/login.php?Username=Paul&Pass=1234&Email=sample@url.com"

Though URL parameters might have to be encoded properly so they don’t mess up the URL structure. Certain characters (for example “/”, “&”, “=”, …) must not appear inside of a parameter itself and need to be escaped. For this you can use WWW.EscapeURL

So to construct the correct URL you would do

WWW Login = new WWW (UserLoginURL + "?Username=" + WWW.EscapeURL(Username) + "&Pass=" + WWW.EscapeURL(Pass) + "&Email=" + WWW.EscapeURL(Email));

Note that the case of the URL parameter usually matters. So “Username” is not the same as “username” or “UserName”. By convention most use only lowercase parameter names or “lowerCamelCase”.

If you’re not familiar with the URL syntax, look it up on wikipedia.