Based on this code, how would I make a register button
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 20
- Joined: Wed Sep 07, 2022 4:26 pm
Based on this code, how would I make a register button
So I've gotten this far
global gUser,gPassword
on logIn
ask "Enter your username here:"
put it into tUsername
ask "Enter your password here:"
put it into tPassword
if tUsername = gUser and tPassword = gPassword then
goToStart
otherwise
answer "The username or password was incorrect"
end if
end login
But how would I make a register button to this, I need these to connect. So when registered its a valid login and when input right it goes to the next card.
EDIT: Hello I am a curious bystander and I am new here and hello world
global gUser,gPassword
on logIn
ask "Enter your username here:"
put it into tUsername
ask "Enter your password here:"
put it into tPassword
if tUsername = gUser and tPassword = gPassword then
goToStart
otherwise
answer "The username or password was incorrect"
end if
end login
But how would I make a register button to this, I need these to connect. So when registered its a valid login and when input right it goes to the next card.
EDIT: Hello I am a curious bystander and I am new here and hello world
Last edited by Curiousbystander on Wed Sep 07, 2022 6:47 pm, edited 1 time in total.
Re: Based on this code, how would I make a register button
Hi Curiousbystander,
welcome to the forum!
Well except for the syntax this should be working.
Change this, and please use the CODE tag after pasting your script here.
This way the formatting will be kept.
Best
Klaus
P.S.
Personal note: A little "Hello" or something would not have hurt for the very first posting.
welcome to the forum!
Well except for the syntax this should be working.
Change this, and please use the CODE tag after pasting your script here.
This way the formatting will be kept.
Code: Select all
on logIn
ask "Enter your username here:"
put it into tUsername
ask "Enter your password here:"
put it into tPassword
if tUsername = gUser and tPassword = gPassword then
## goToStart
go next cd
## otherwise :-)
ELSE
answer "The username or password was incorrect"
end if
end login
What exactly do you mean with "register button"?But how would I make a register button to this, I need these to connect. So when registered its a valid login and when input right it goes to the next card.
Best
Klaus
P.S.
Personal note: A little "Hello" or something would not have hurt for the very first posting.
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Based on this code, how would I make a register button
Where will this registration be sent?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Based on this code, how would I make a register button
Hi.
You have a few issues, mainly with the language, but also because you have elements within your handler which contain no data.
Check out this stack. It does what I think you intended. The details that are built-in can be modified to your liking later.
Craig
You have a few issues, mainly with the language, but also because you have elements within your handler which contain no data.
Check out this stack. It does what I think you intended. The details that are built-in can be modified to your liking later.
Craig
-
- Posts: 20
- Joined: Wed Sep 07, 2022 4:26 pm
Re: Based on this code, how would I make a register button
Hi, thank you for the replies.
Sorry I wasn't being clear enough. So what I'm trying to do is have a register button, like if I clcik register right. I type in the username and password that I want, then the login button recognizes the data and I can use that to login with.
Hope that sums it up better, that's what I am looking for here.
Sorry I wasn't being clear enough. So what I'm trying to do is have a register button, like if I clcik register right. I type in the username and password that I want, then the login button recognizes the data and I can use that to login with.
Hope that sums it up better, that's what I am looking for here.
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Based on this code, how would I make a register button
Is the data stored only locally?
And is this for desktop or mobile?
And is this for desktop or mobile?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Based on this code, how would I make a register button
Can anyone tell me what a "register" button looks like, and how it works? Does clicking on a certain part of such a control do different things?
And how it differs from a "Login" button?
Craig
And how it differs from a "Login" button?
Craig
-
- Posts: 20
- Joined: Wed Sep 07, 2022 4:26 pm
Re: Based on this code, how would I make a register button
Stored locally yeah,
Desktop.
I mean its just a normal button thats going to say register. U click on it and i want a pop up to say "what username do you want" and then u type in whatever, and same thing for password. once those are typed in u use the login button and type in whatever u wrote in the register button and u can login.
Desktop.
I mean its just a normal button thats going to say register. U click on it and i want a pop up to say "what username do you want" and then u type in whatever, and same thing for password. once those are typed in u use the login button and type in whatever u wrote in the register button and u can login.
Re: Based on this code, how would I make a register button
Ah.
OK, nothing particularly special. Did you try either my stack or Klaus' handler?
The details in my stack are just about how you want to store the password and userName, and what you want to do afterwards. I just used two fields to hold the "correct" answers to the two questions. You will change that into whatever you want.
Craig
OK, nothing particularly special. Did you try either my stack or Klaus' handler?
The details in my stack are just about how you want to store the password and userName, and what you want to do afterwards. I just used two fields to hold the "correct" answers to the two questions. You will change that into whatever you want.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 10045
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Based on this code, how would I make a register button
How sensitive is the data?Curiousbystander wrote: ↑Wed Sep 07, 2022 8:54 pmStored locally yeah,
Desktop.
I mean its just a normal button thats going to say register. U click on it and i want a pop up to say "what username do you want" and then u type in whatever, and same thing for password. once those are typed in u use the login button and type in whatever u wrote in the register button and u can login.
User accounts already require password to log in, so if your app needs a second password I'm guessing this is serious data, yes? If so, you'll want to encrypt the stored key, and in hash form only.
Can you tell us a bit about what the application does?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 20
- Joined: Wed Sep 07, 2022 4:26 pm
Re: Based on this code, how would I make a register button
Yes, I tried it. I understand it but not exactly what I was looking for but I'll hold on to it for future purposes.dunbarx wrote: ↑Wed Sep 07, 2022 10:23 pmAh.
OK, nothing particularly special. Did you try either my stack or Klaus' handler?
The details in my stack are just about how you want to store the password and userName, and what you want to do afterwards. I just used two fields to hold the "correct" answers to the two questions. You will change that into whatever you want.
Craig
Not sensitive at all, it's not going to be shown to anyone it's more of like a practise project. It's nothing serious just a test and try type of project to try to learn myself better.FourthWorld wrote: ↑Wed Sep 07, 2022 11:51 pmHow sensitive is the data?Curiousbystander wrote: ↑Wed Sep 07, 2022 8:54 pmStored locally yeah,
Desktop.
I mean its just a normal button thats going to say register. U click on it and i want a pop up to say "what username do you want" and then u type in whatever, and same thing for password. once those are typed in u use the login button and type in whatever u wrote in the register button and u can login.
User accounts already require password to log in, so if your app needs a second password I'm guessing this is serious data, yes? If so, you'll want to encrypt the stored key, and in hash form only.
Can you tell us a bit about what the application does?
Well to start with it's only a login and a register app and then I'll find out what I want to do with it on the next card lol. It's basically going to register an account locally, locally login and then it goes to the next card once it recognizes the account registered.
Re: Based on this code, how would I make a register button
My handler is exactly what you were asking for.Curiousbystander wrote: ↑Thu Sep 08, 2022 12:29 pmYes, I tried it. I understand it but not exactly what I was looking for but I'll hold on to it for future purposes.dunbarx wrote: ↑Wed Sep 07, 2022 10:23 pmAh.
OK, nothing particularly special. Did you try either my stack or Klaus' handler?
The details in my stack are just about how you want to store the password and userName, and what you want to do afterwards. I just used two fields to hold the "correct" answers to the two questions. You will change that into whatever you want.
Craig
...

The missing link/big question however is, when and how do you fill your two global variables with the correct values
so you can actually compare them in the handler?
-
- Posts: 20
- Joined: Wed Sep 07, 2022 4:26 pm
Re: Based on this code, how would I make a register button
Ok looks like ive confused myself here lol.
Ok, how would I make this button.. without the global variables. I want a login button and I want a register account button lets say.
I click on the register account button. It says "What would you like your username to be" I type that in. and then again "What would you like your password to be". I type that in as well. Now the LOGIN button will have that stored (locally) as said just testing project.
When I type in that in the login button it should go to the next card.
I realize I'm making shit harder than it's supposed to be lol
Ok, how would I make this button.. without the global variables. I want a login button and I want a register account button lets say.
I click on the register account button. It says "What would you like your username to be" I type that in. and then again "What would you like your password to be". I type that in as well. Now the LOGIN button will have that stored (locally) as said just testing project.
When I type in that in the login button it should go to the next card.
I realize I'm making shit harder than it's supposed to be lol
Re: Based on this code, how would I make a register button
AHA!
OK, in that case use the globals to store the users chosen username and password for comparing later.

OK, in that case use the globals to store the users chosen username and password for comparing later.
-
- Posts: 20
- Joined: Wed Sep 07, 2022 4:26 pm
Re: Based on this code, how would I make a register button
Could you show me how, if possible.
I'm sitting here trying not working out for me
I'm sitting here trying not working out for me