Created
January 29, 2017 20:40
-
-
Save CloudyWater/cba5707c85f630db08ea34269abffad4 to your computer and use it in GitHub Desktop.
Added the following code to DatabaseConnection.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private const string GET_USER_URL = "http://localhost/GetUser.php?"; | |
public void LogInAccount (string username, string password) | |
{ | |
StartCoroutine (PostLoginAccount (username, password)); | |
} | |
IEnumerator PostLoginAccount (string username, string password) | |
{ | |
string postUrl = GET_USER_URL + "username=" + WWW.EscapeURL (username); | |
WWW hsPost = new WWW (postUrl); | |
yield return hsPost; | |
if (hsPost.error != null) | |
{ | |
Debug.Log ("Error: " + hsPost.error); | |
} | |
else | |
{ | |
if (Crypto.Decrypt (hsPost.text).Equals (password)) | |
{ | |
Debug.Log ("Success! Correct password entered."); | |
} | |
else | |
{ | |
Debug.Log ("Error! incorrect password entered."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment