yafreax Posted October 21, 2002 Posted October 21, 2002 i set a token using the --- input=hidden name=-token value=[FMP-Field: Name] --- and it works just dandy... Problem is i need the token to work in a link and it's not... It's an auto refresh link, they enter their name and some other info and the next page uses that information to auto forward the user to a different page depending on what they entered in certain fields... we do this using a calculation field in the actual data base and in the code of the page (not the header) we have: META HTTP-EQUIV="REFRESH" CONTENT="1 ; URL=[FMP-Field: URLRedirect]" It always redirects just fine... so since now i need to set the token and PASS the token through the redirect, i went to the database and used the following syntax: http://255.255.255.255/folder/FMPro?-Db=database&-lay=layout&-format=file.htm&-token=[FMP-Field: Name]&-view The token doesnt get set. It still goes to the right spot but the token becomes "[FMP-Field: URLRedirect]" rather than becoming the value. I've tried it with -edit at the end as well... Is my syntax just wrong? Again, i set the token successfully on the same redirect page if i use the input type=hidden token tag, but, of course, simply doing that doesnt pass the token... I dont want to use cookies cause there is talk that they are unstable. TIA Jeremy
Jeff Spall Posted October 21, 2002 Posted October 21, 2002 Hi, I think the problem here is that the redirect is just done at web browser level whilst you need an FMP-action to pass the token. I share your reservations about Filemaker cookies, but I've usually been able to get an FMpro session cookie to work - they only seem to fall down on some platform/browser combinations when you want to set a persistant one. regards, jeff
yafreax Posted October 23, 2002 Author Posted October 23, 2002 it looks as though i am using a FMP-action in my redirect link... that's why i dont understand why it wont pass. (kinda like consti... nevermind) ... the strange thing is that the token doesnt even set in the link in the first place (when i use view source from that page)... but anyway, we absolutely cant chance a cookie not working... even if the chances are slim. I'm trying to get a javascript cookie to work, but the problems i'm having with that is for a different forum. any other thoughts or suggestions from Jeff or others?
Garry Claridge Posted October 23, 2002 Posted October 23, 2002 As Jeff said the -Token assignment is coming too early. A pass through FM is needed to replace the [FMP-Field] tag before the -Token assignment is passed through FM. Can you set the -Token earlier? I have done some mixing of CDML and Javascript Cookie coding if you want to have a look at that. All the best. Garry
yafreax Posted October 28, 2002 Author Posted October 28, 2002 well, the token is set before hand and i tested this by using the "-token" tag in the same page that i try to use the link... at any rate, i see this part of the discussion going in circles. I am very interested in seeing what you have on CDML and javascript cookies. Please contact me or repost to hear and let me know what you got. Thanks much! Jeremy
Garry Claridge Posted October 28, 2002 Posted October 28, 2002 Here is how to read, and use, a Cookie called recid with Javascript: <script> var allcookies = document.cookie ; var pos = allcookies.indexOf("recid=") ; if (pos != -1) { var start = pos + 6 ; var end = allcookies.indexOf(";",start) ; if (end == -1) end = allcookies.length ; var value = allcookies.substring(start, end) ; } else { var value = 1 ; } ; </script> </HEAD> <BODY BGCOLOR="#FFFFFF"> This is the last page of Course 7. Please read.<br> <form action="FMPro" method="post"> <input type="hidden" name="-db" value="courses.fp5"> <input type="hidden" name="-lay" value="cgi"> <input type="hidden" name="-format" value="main_.htm"> <input type="hidden" name="course7" value="Completed"> <script> document.write('<input type="hidden" name="-recid" value="' + value + '">'); </script> <input type="submit" name="-edit" value="Click here when finished"> Hope this helps. Garry
Garry Claridge Posted October 28, 2002 Posted October 28, 2002 Jeremy, I just re-read your original question. The &-token=[FMP-Field:name] tag will not be replaced from within an [FMP-Field: URLRedirect] tag. That is, nested tags will not work. Hope the Cookies work. All the best. Garry
Recommended Posts
This topic is 8131 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