Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class DataInserter : MonoBehaviour
- {
- string CreateUserURL = "http://xxnorxx.alwaysdata.net/insertUser.php";
- public string inputUsername = "";
- public string inputPassword = "";
- public Canvas main;
- public Canvas register;
- public InputField IFUsername;
- public InputField IFPassword;
- // Use this for initialization
- void Start ()
- {
- }
- // Update is called once per frame
- void Update ()
- {
- if (regPress)
- {
- CreateUser(inputUsername, inputPassword);
- inputUsername = "";
- inputPassword = "";
- main.enabled = true;
- register.enabled = false;
- regPress = false;
- }
- }
- public void CreateUser(string username, string password)
- {
- WWWForm form = new WWWForm();
- form.AddField("usernamePost", username);
- form.AddField("passwordPost", password);
- WWW www = new WWW(CreateUserURL, form);
- }
- bool regPress = false;
- public void btnReg()
- {
- if (IFUsername.text != "" && IFPassword.text != "" && IFUsername.text != "" && IFPassword.text != "")
- {
- inputUsername = IFUsername.text;
- inputPassword = IFPassword.text;
- IFUsername.text = "";
- IFPassword.text = "";
- regPress = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement