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;
- using System.Net;
- public class Login : MonoBehaviour {
- public Text usernameinput;
- public Text passwordinput;
- public static Login instance;
- //User stats
- public static string username;
- private void Awake()
- {
- instance = this;
- }
- public void signin()
- {
- username = usernameinput.text.ToString();
- string password = passwordinput.text.ToString();
- WebClient wc = new WebClient();
- string loginresult = wc.DownloadString("http://localhost/game.php?action=login&username=" + username + "&password=" + password);
- if (loginresult.Contains("1"))
- {
- Debug.Log(username);
- Application.LoadLevel(1);
- }
- else
- {
- Debug.Log("Wrong username or password");
- Debug.Log(username);
- Debug.Log(password);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement