my script is in working order (tried and tested in localhost) however
“http://mysite.com/register.php”
I just uploaded my register.php through FileZilla to my site. how do I get the exact URL for my register.php to call from a Unity www.form?
has anyone on hear actually done this on a site rather then just Lochalhosting?
TITLE404 Not FoundTITLE
The requested URL was not found on this server.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class LoginRegister : MonoBehaviour {
public string UserLoginURL = "http://mysite.com/loggin.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" + User + "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 (UserLoginURL + "Username" + User + "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 FLASS //--------------------------------------------------------------------