mindtpi99 Posted February 24, 2004 Posted February 24, 2004 Hi Could someone tell me if this is possible - I have a global field (aelist) in my database with several user names, what I want to do is check the current username against a name in 'aelist' to see if there is a match. The code I though it would be is (doesn't seem to work) - thanks. Also, why can't I post any text after the code below in this forum? [FMP-if:aelist.cn.{currentusername}]Hit[FMP-Else]Miss[/FMP-if]
Steve T. Posted February 24, 2004 Posted February 24, 2004 Hi, mindtpi99! Umm... I may be wrong (correct me, folks!) but isn't it [FMP-ClientUserName] for web users? Also, I'm only a semipro-once-in-a-while FileMaker Web developer so I get rusty, but here's my guess at what your tag should be... [FMP-if: field:aelist .cn. {FMP-ClientUserName}]Hit[FMP-Else]MIss[/FMP-if] Sorry -- can't help w/the code problem since I don't like to use it, but I don't think others have had trouble. If you are manually typing in the "code" command, maybe you need to close the tag? I almost always use the QUICK REPLY but I just checked the normal reply area and it has a little auto-thing that puts the tags up for you (both opening and closing code tags) and maybe you're closing tag fell off? I dunno. --ST
Justin Grewe Posted February 24, 2004 Posted February 24, 2004 Mindtpi99, Why are you using a global field that has all the user names in it? Is it a repeating field? Otherwise how would you store diffrent user names when a global is universal throughout the entire database? Also, try not to use globals while web-publishing. It can mess everything up. Justin Grewe
Jeff Spall Posted February 24, 2004 Posted February 24, 2004 Hi, "try not to use globals while web-publishing" - good point Justin. People developing FileMaker for client/server environments often use Globals for temporary storage. Bad move on the web as you don't know who else is going to submit at almost exactly the same time. Store stuff in Tokens or cookies (FMPro cookies work reliably if they are set to expire at the end of the session). Also the syntax for a field in the right side of an "If" should be: [FMP-IF:fieldname.cn.Field.fieldname2] or using a cookie: [FMP-IF: FMP-COOKIE:userid.eq.Field.username] FileMaker expects a field on the left side so you don't need to declare "Field", but expects text /number on the right so "Field" is needed. You don't need to bracket it, in fact I think that doesn't work. Like most PMP stuff it doesn't appear to be case sensitive. regards, jeff
Garry Claridge Posted February 25, 2004 Posted February 25, 2004 I believe that mindtpi99 keeps a list of users in a Global for validation purposes. If that is the case it should work well! All the best. Garry
Justin Grewe Posted February 27, 2004 Posted February 27, 2004 Garry, How would mindtpi99 keep multiple instances of users in one global? A global is not allowed to be a repeating field, right? And the global is universal with only one value at a time throughout the entire database, right? How else is this possible then Garry? If there is a way, I would really like to know. Justin Grewe
Garry Claridge Posted February 27, 2004 Posted February 27, 2004 My assumption is that it is a list of users allowed certain access. By using "contains" as the search criteria, a string of many words can be used. For example: "Allowed Users" Global Text { smith, jones, boots, green, bloggs } The Form would have: <input type="hidden" name="-op" value="cn"> Enter User Name: <input type="text" name="Allowed Users" value=""> All the best. Garry
Justin Grewe Posted February 27, 2004 Posted February 27, 2004 Garry, Thank you, this makes sense. Justin Grewe
mindtpi99 Posted March 3, 2004 Author Posted March 3, 2004 Thanks for everyone's comments - Garry is quite correct in what I want to do.... The format for the conditional for what I wanted to do that seems to work is; [FMP-IF:globalfieldname.cn.{clientusername}]Show this HTML Code[FMP-Else]Don't show it[/FMP-if] cheers howard
Recommended Posts
This topic is 7562 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now