Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Please Help: Login and Password

Featured Replies

Hi everyone. I have a member's login page and I've tried using the code below but there must be errors!

code:


[if: (Error_CurrentError) >= 1]

Sorry, the User Name and Password you provided were invalid. Please try again.

[/if]

<form action="action.lasso" method="post" name="loginform">

<input type="hidden" name="-database" value="Users.fp5">

<input type="hidden" name="-layout" value="cgi">

<input type="hidden" name="-response" value="userhome.lasso">

<input type="hidden" name="-AnyError" value="login.lasso">

<input type="hidden" name="-LogicalOperator" value="and">

<input type="hidden" name="-Operator" value="equals">

<input type="hidden" name="UserStatus" value="Active">

Member Name:

<input type="hidden" name="UserName" value="==">

<input type="hidden" name="-Operator" value="equals">

<input type="text" name="UserName" size="30" value="">

Password:

<input type="hidden" name="Password" value="==">

<input type="hidden" name="-Operator" value="equals">

<input type="password" name="Password" size="30" value="">

<input type="submit" name="-search" value="Sign In">


Problem 1

At the moment, if a member just enters his UserName (exactly and correctly) then he'll get in. Or if a member just enters his Password (exactly and correctly) then he'll get in. He doesn't need to enter both. How do I create a secure login page?

Problem 2

My [if: (Error_CurrentError) >= 1] tag doesn't seem to work. The words "Sorry, the User Name and Password you provided were invalid. Please try again." can be seen even if no error took place. How do I create a proper [if] tag?

I would be extremely grateful if somebody could help me! Thanks for your time! crazy.gif" border="0smile.gif" border="0

Problem 2

Look at the problem the other way round!

try

[if: (Error_CurrentError) == (Error_NoError)]

normal HTML CDML (everythings OK)

[Else]

Somethings wrong

[/if]

Problem 1

I combine the Username, an alphanumeric string and password to create a single value. (i use an alphanumeric string to stop duplication of the combined values, by this i mean: test + test = testt + est !

I then use exact match in the field security only for the combined field. (no need for the "==" but you need the -operator = "eq" hidden element, again only on the combined field)

The values are combined using calculated field in your setup but if you use Variables inlines etc you can use string_insert and enter into a standard text field. Also calculated fields can't be indexed so searching on them is slower (not much but better than no security!)

To log the user back in you have to repeat the process using JavaScript from a login page.

The javascript would be something like;

code:


<form name="insert">

Alpha string

<input type="hidden" name="alpha" value="AIHJUHdhuada92394fhsffsdjfjsdfsj">

Putting this in a seperate form stops it being submitted

</form>

<form action="action.lasso" method="post" name="loginform">

<input type="hidden" name="-database" value="Users.fp5">

<input type="hidden" name="-layout" value="cgi">

<input type="hidden" name="-response" value="userhome.lasso">

<input type="hidden" name="-AnyError" value="login.lasso">

<input type="hidden" name="-LogicalOperator" value="and">

<input type="hidden" name="-Operator" value="equals">

<input type="hidden" name="UserStatus" value="Active">

Member Name:

<input type="text" name="UserName" size="30" value="">

Password:

<input type="password" name="Password" size="30" value="">

Added Values

<input type="hidden" name="-Operator" value="eq">

<input type="text" name="serial">

I've left serial as text because if you change the submit button into a button button (type="button") you can see the JavaScript add the values and stick it into the field. Obviously you would want to change text to hidden and button to submit later! This addition process can be hidden from the user with Variables String_insert and Inlines, however this is a bit too much to explain here.

<input type="submit" name="-search" value="Sign In" onClick="document.loginform.serial.value=document.loginform.UserName.value + document.insert.alpha.value + document.loginform.Password.value; return true">


I appologise for any typos!!!

hope this helps

laugh.gif" border="0

[ August 08, 2001: Message edited by: scratchmalogicalwax ]

[ August 08, 2001: Message edited by: scratchmalogicalwax ]

  • Author

Hello... laugh.gif" border="0

quote:

Originally posted by scratchmalogicalwax:

Problem 2

Look at the problem the other way round!

try

[if: (Error_CurrentError) == (Error_NoError)]

normal HTML CDML (everythings OK)

[Else]

Somethings wrong

[/if]


Thanks a lot for that advice scratchmalogicalwax! The [if] tags work fine now. smile.gif" border="0 Yay!! laugh.gif" border="0

Thanks for your answer to problem 1. I think I understand your login page and it sounds like a very good idea...

but... in CDML all I had to do, in order to ensure that both "UserName" AND "Password" fields did an exact match (even when left blank), was:

code:


Insert

<input type="hidden" name="UserName" value="=">

Before

<input type="text" name="UserName" size="30">

And

Insert

<input type="hidden" name="Password" value="=">

Before

<input type="password" name="Password" size="30">


...and it worked great. Isn't there something similar that I can do in LDML, without having to use a combination field and javascript?

Thanks for all your time! smile.gif" border="0

To be honest i haven't tried it that way using LDML but i can't see why it wouldn't work.........I developed my system because in the past I have found FMPro a bit unreliable when doing exact searches with two fields. This way I have told Lasso / FMPro to return exact matches and on only one field for all searches so as to increase the reliability.

Try setting exact match on both fields instead of adding the "=" you will have to have both values every time you do a search though and don't forget the Opeator eq

Give your old method a go with one and 2 "=" and with and without the operator eq (don't work very well but are required when exact search is stated in field setup)

You could also have a look at the action filter for search action and string_insert the "=" in front of the [Var: 'Filter_Field''] (the value of the field is assigned to this variable for manipulation in the action filters).

There are many ways to achieve your required result you have to find the one that best suits your needs and the time you have to develop it.

hope this helps......

laugh.gif" border="0

NB I wouldn't set exact match in Lasso AND add "=" in front of your values I would imagine this would return a field restriction error.

laugh.gif" border="0

[ August 09, 2001: Message edited by: scratchmalogicalwax ]

quote:

Originally posted by Krishan:

Hello...
laugh.gif" border="0

code:

Insert

<input type="hidden" name="UserName" value="=">

Before

<input type="text" name="UserName" size="30">

And

Insert

<input type="hidden" name="Password" value="=">

Before

<input type="password" name="Password" size="30">


...and it worked great. Isn't there something similar that I can do in LDML, without having to use a combination field and javascript?

Thanks for all your time! smile.gif" border="0


Hey Krishan,

Long time no hear. What you need to do is when the user logs in it creates a record in a login database. This record has a field for the user name input, and one for the password input. Then you have another field in this database that is a calculation field and all this field does is combines the two values (i.e. = user&password). The calculation result is text.

In your users database it also has a calculation field that combines the username and password. So when the user logs in and the record is created in the login database, you just compare the value in the calculated field in the login database with the value in the calculated field in the users database and voila! It works and they need the two values to match.

  • Author

Hi scratchmalogicalwax and Proton!

Thanks for your replies. I will mess around with the "=" signs and "equal" operators to see if I can create a simple login form. It's surprising that I can't create a simple "AND" search form which translates an empty field to equal "nothing" .....and thus no records will be found if a field is left blank.

Oh well, I guess if I can't work out how my simple CDML form can be coverted to LDML.... I'll have to create another field and make that a calculation equal to the "UserName + Password".

Thanks a lot for all your advice. I think it's pointed me in the right direction and I should figure out something. laugh.gif" border="0smile.gif" border="0

Cheers guys!

  • Author

Hi everyone!

I figured out a good way to make my login page. Basically I kept my two fields the same... the UserName and Password. I placed "equal" operators infront of the fields too. Then in Lasso Security, I used the Action Filters in the Field Level Security of my database. All I had to put into the "Search Filter" was:

code:


[Variable_Set:'len'=(String_Length : (Variable:'filter_field'))]

[if : (Variable:'len')<6]

[Error_SetErrorCode : (Error_FieldRestriction: ErrorCode)]

[/if]


Which means that you can only search that field if you use 6 or more characters. By using that and my "equals" operator, it's quite a clean job and does the trick. My main problem was that before the User could just type in his UserName and leave the Password field blank (i.e. Password field length = "0", since it's empty)... and still find records. But the filter solves that problem, since "0" < "6". I filtered both my UserName and Password fields.

Is this a good way of doing it? Please tell me if you think there's a flaw in my thinking!

.....slowly learning.... smile.gif" border="0

[ August 17, 2001: Message edited by: Krishan ]

  • Author

The -Required tag can be used to require that a value is entered into a field before a form is submitted. The -Required tag is placed before an input field in a form, and applies only to the field that immediately follows. The -Required tag can be specified for several fields on the same form as follows:

<input type="hidden" name="-Required">

<input type="hidden" name="-Operator" value="eq">

<input type="text" name="YouFieldName" size="30">

<input type="hidden" name="-Required">

<input type="text" name="SomeOtherFieldName" size="30">

Any form submitted without values entered into the "required" field is rejected, and Lasso returns a "required field missing" error.

A customized error page can be specified using the -ReqFieldMissingError tag.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.