MetroMail Responsive Email Template
 
 
icon 2    February 21st, 2014
 
 
 
UPDATES & NEWS FOR THE LIVECODE COMMUNITY
 
 
 
 
 
 
 
Article 4: A Simple Login System
 
 

In this lesson we will teach you how to create a simple login system that can be used on your stack. Although this is a simple method of implemeting such a feature, it can be built upon to create more advanced systems.

Create a new stack

1) Create a new stack
2) Name the stack "Login Test"
3) Name this first card "Login"

Create a new card

1) Create a new card and call it "accessed"

Setup accessed card

1) Add label field with "Access Granted"
2) Add button with following script

 

on mouseUp
go to the first card
end mouseUp

Create Login card elements

1) Navigate to log in card
2) Create two input fields. One called username and one called password
3) Create two label fields. One with its contents set to "Username" and the other "Password"
4) Create a button and set its label to "Login"

Edit the script of the card

Place the following in your card script

 

local sUsername, sPassword

on openCard
put "johnsmith" into sUsername
put "pa55word" into sPassword
end openCard

on loginCheck
if field "username" is sUsername and field "password" is sPassword then
answer "Login Successful"
go to card "accessed"
else
answer "Details Incorrect. Please try again!"
end if
end loginCheck

Edit the script of the "Login Button"

Call the "loginCheck" handler from the mouseUp of this button

Test the Script

The above script puts a defined username and password into a variable and then the loginCheck handler checks if the contents of the username and password fields matches these values.

If a match is successful then you progress to the next card. However, if details are in-correct then an answer dialog is shown.

LiveCode Lessons

 

This article comes from our extensive Lessons repository, see more here.

 
 
section image
 
LiveCode 6.6 Alpha
 
Get your hands on this latest test release with great features
 
read more
 
 
section image
 
Cloud/DB Academy
 
All about our latest Academy with exhaustive DB and Cloud info
 
read more
 
 
section image
 
Bootstrap with Bootcamp
 
The benefits of a hands on live tutored training course
 
read more
 
 
section image
 
Simple Login System
 
A hands on tutorial creating a simple Simple Login System mobile app.
 
read more
 
 
 
Join Us in San Diego
 

Early Bird Pricing Still Available!

 
download
 
 
Featured Extensions
 
 
Data Grid Helper
 
Enhance your productivity with this great and intuitive interface for building LiveCode Data Grids
 
read more
 
 
 
Interface Sounds Pack
 
A full compliment of clicks, beeps and pops to attach to any of your menu actions. Bring your interface to life!
 
read more
 
Connect With Us
 
 
RunRev © Copyright 2013 . All Rights Reserved
 
 
 
RunRev © Copyright 2013 . All Rights Reserved