Jump to content

-token confusion


This topic is 8580 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Can someone offer me some assistance in using the token tag (-token; [FMP-CurrentToken]).

I am not quite sure how to use them, and where they would go. I've read the simple examples <type=hidden name=-token value=[FMP-CurrentToken]

I understand the concept of the token which passes information to a format file. But does it pass information from one file to another? Any insight would be greatly appreciated. I am working on a project an would like to understand this feature to implement.

------------------

Rich

Link to comment
Share on other sites

quote:

Originally posted by RichJr:

Can someone offer me some assistance in using the token tag (-token; [FMP-CurrentToken]).

I am not quite sure how to use them, and where they would go. I've read the simple examples <type=hidden name=-token value=[FMP-CurrentToken]

I understand the concept of the token which passes information to a format file. But does it pass information from one file to another? Any insight would be greatly appreciated. I am working on a project an would like to understand this feature to implement.


Rich,

this isn't really for you, but it could be (sorry). . .

Since we're on the subject of passing info from one page to another, I would also like to know if anyone could explain the Cookie tags as well. I understand the concept of both tokens and cookies, but i can't seem to get them to pass right!! It's so frustrating. I'll set a cookie on one page, and i can't view on the very next page! It's getting old, because we know that there are some of you out there that can explain how to do either one of these tasks, but i've tried everywhere, and i can't get an answer. Both processes seem easy enough, i just can't seem to implement them right.

Do Us Both a Favor wink.gif

Jeremy

Link to comment
Share on other sites

This may not be the best example, but this is how I used tokens.

There are two databases, Clients and Calls. Clients are uniquely identified by their Client ID. Calls are identified by their Call ID and have a field called Client ID to identify the caller.

A Client Info form displays one existing record (Client ID and contact info, etc). From this form I want to be able to create a new CALL record using a URL link. I want the current Client ID number to be passed along and entered automatically in the next -format file loaded. To do this I used the following code:

<!-- pass Client ID value to New Call Record form -->

<a href="FMPro?-db=calls.fp3&-Token=[FMP-field: Client ID]&lay=&-format=new_call.htm&-max=10&-findall">Add New Call</a>

Following the above link takes you to a New Call Record form which has all blank fields except for Client ID which I have passed from the Client record.

To have the value of the token display in the New Call Record form (format file: new_call.htm)...

<input type="text" name="Client ID" value=[FMP-CurrentToken]>

One thing to note is that you can only store/pass one token at a time in FileMaker 4. I believe you can pass up to 9 tokens at one time in FileMaker 5.

Link to comment
Share on other sites

  • 2 weeks later...

Only one token can be worked with at one time, so if you need to "remember" two or more things at one, bad luck.

You can set and use as many cookies as you like. Cookies can be persistent on each user's computer so they can be "remembered" between sessions too.

To set a cookie, use the tag...

[FMP-SETCOOKIE: CookieName=something, EXPIRES=5256000]

... the trick is that you have to give the cookie a name (CookieName) and tell FMP what value to give it. The cookie generates itself, no need to be in a form or anything. (BTW 5256000 is ten years.)

To use the cookie... well that dpends on what you want to do with it. If you just want the cookie value to appear on the web page use the tag...

[FMP-Cookie: CookieName, encoding]

let's say I use this tage to set a cookie...

[FMP-SETCOOKIE: Cookie1=Field: Subscribed, EXPIRES=5256000]

Then "Cookie1" will take on whatever value was in the field called "Subscribed" at the time the page was generated. To make this data appear on the web page I'd use the code...

[FMP-Cookie: Cookie1, raw]

To make it look nice it might be...

<b>Your subscription status is:</b> [FMP-Cookie: Cookie1, raw]

---

Link to comment
Share on other sites

  • Newbies

I was glad to find this posting as passing the value of a field in one database into another database over the web is exactly what i am trying to do!

Unforunately I have tried using the token command and it does pass something to the next page but all it passes is the tag

[FMP-field:ID] (in my case) and not the content of the field ID as seen on that page!

I have a database of web links which can be searched and updated over the web. I am trying to add the facility to review the sites - so i have a database of links each with a unique ID field and I have a database of reviews each also with a unique review ID but also a link_ID field with which to associate them with the links.

Problem is getting the link ID back off the record details page and into the 'add a review page'!

Any ideas where I am going wrong?

Cheers

Al

<!-- pass Client ID value to New Call Record form -->

<a href="FMPro?-db=calls.fp3&-Token=[FMP-field: Client ID]&lay=&-format=new_call.htm&-max=10&-findall">Add New Call</a>

Following the above link takes you to a New Call Record form which has all blank fields except for Client ID which I have passed from the Client record.

Link to comment
Share on other sites

  • 2 weeks later...

I have created a web photo gallery as a personal exercise, using an FMP database as the back end. On it people can add comments or even send postcards. The comments functionality could be similar to what you are trying to do with the reviews.

The Comments database is related to the images database through an image serial number. This number is passed on to the comments database through a hidden field tag on a form...

<INPUT TYPE=hidden NAME=ImageSerialNumber VALUE="[FMP-Field: SerialNumber, html]">

...where the serial number is taken from the images record, and the action in the form creates a new record in the comments database and sets the match field to the same value.

Note that I don't use Tokens for this purpose.

I do use a token to carry accross the name of the image, but this is really just for "cosmetic" purposes to make the interface a bit nicer. The tag for the token is:

<INPUT TYPE="hidden" NAME="-Token" VALUE="[FMP-CurrentFind][FMP-FindValueItem:URL][/FMP-CurrentFind]">

To have a look at the site, pop over to...

http://138.25.32.40/gallery/index.html

... but remember it *is* a test bed for my CDML and web publishing learning!

Link to comment
Share on other sites

  • 2 months later...

well, i know i am kinda digging up an old post here, but i was just wondering if there is away to delete a cookie that you create in the ways explained in the post???

just wondering, not all that important.

or would just setting the cookie again with no value or something like that work???

[This message has been edited by bman (edited November 21, 2000).]

Link to comment
Share on other sites

Re: cookies.

I hate Netscape -- I am webmaster and the time to spend on Netscape debugging makes me angry.

But Netscape is perfect with cookies, actually you can set and write cookie on page and at the bottom of that page you can evaluate the cookie.

Not in MSIE.

Let me quote my contribution to both GoLive discussion forums:

Netscape handles cookies much better, than MSIE. Cookies are not reliable in MSIE at all. Because of that I had to redesign and re-program my discussion forum....

I guess I hate MSIE as well.

As webmaster coming from FileMaker world all browsers are craps. We are in hands of lunatics....

Link to comment
Share on other sites

Every one is correct in saying that in FM4 you can only pass one token but in FM5 you can pass up to 9 tokens at any one time by using -token.1 upto -token.9 and calling them back by using [fmp-currenttoken:1] to [fmp-currenttoken:9]

This makes fm5 a lot more powerful than fm4, come on every one upgrade now the experience is really worth it.

Simon

Link to comment
Share on other sites

How about -token.0?

From FM Token help:

Up to nine tokens can be used by using a slightly different syntax for the token tags.

The variable tag -Token can have an optional token specifier of the form -Token.X where X can be the characters 0 through 9.

Amazing, Jim! In Czech Republic that amounts to 10!

Anatoli

quote:

Originally posted by Simonpennington:

Every one is correct in saying that in FM4 you can only pass one token but in FM5 you can pass up to 9 tokens at any one time by using -token.1 upto -token.9 and calling them back by using [fmp-currenttoken:1] to [fmp-currenttoken:9]

This makes fm5 a lot more powerful than fm4, come on every one upgrade now the experience is really worth it.

Simon

Link to comment
Share on other sites

This topic is 8580 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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