Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CLIENT CODE:
- function Login()
- {
- form f = {username, password};
- WWW request = SendRequest("https:/.../login.php", f);
- wait request;
- if(request.error != NULL || request.message == "ERROR")
- return "Error";
- else
- {
- if(request.message == "LOGIN_OK")
- GoForwardAndLoadNextThing();
- }
- }
- SERVER CODE:
- function ProcessLogin(form f)
- {
- Query q = SELECT username WHERE user = f.user AND password = f.password;
- QueryResult result;
- q.DoQuery(result);
- // If there was a match
- if(result != 0)
- die("LOGIN_OK")
- else
- die("ERROR");
- }
Advertisement
Add Comment
Please, Sign In to add comment