Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Filemaker not correctly URL encoding this field...???

Posted on 2006-05-28
6
Medium Priority
?
545 Views
Last Modified: 2008-03-04
I'm a web developer and I've got a client using Filemaker.  I've created a small script for them which charges credit cards with authorize.net using data supplied from the current invoice they're looking at when they click a "charge card" button within Filemaker.  A URL is created using data from the invoice as querystring values.  The problem is, it isn't correctly URL encoding the string.  It's getting spaces correct, using %20 for spaces.  The only problem I've run into is with # signs. It should put %23 for a # sign in a URL encoded string, but it's not, it's just leaving the # sign as is.  This being the case, the web browser sees this as an anchor and stops reading the querystring values, so I can't use the values beyond the # sign in my script.

Any information on how I can make Filemaker handle #'s correctly when sending to a URL would be greatly appreciated.  Thanks!
0
Comment
Question by:Andrew Angell
  • 3
  • 3
6 Comments
 
LVL 28

Expert Comment

by:lesouef
ID: 16782808
fm does not encode anything in URL's except spaces; it's up to you to do it.
but that's no great deal if you know which characters you'll use.
Just use the subst function on the field or variable containing the URL to swap forbiddent characters with the right % ascii code.
example:
Substitute ( table::url ; "#" ; "%23" )
if you have several records where you'd like to do this, you can use the replace function which does it on a found set of records
0
 
LVL 28

Expert Comment

by:lesouef
ID: 16782863
if you have several characters to replace, you can embed the replacement like this instead of executing the subst function several times:
Substitute ( Substitute (table::url;"é"; "é" ); "#"; "%23" )
0
 
LVL 11

Author Comment

by:Andrew Angell
ID: 16794277
Ok, well I found the substitute function in the list within the Script Maker, but I'm getting a message saying it can't find the specified table for some reason, even though I'm selecting it right from the list it gives me in the Script Maker.  The file is called Invoices.fp8 and the field the URL is being held in is AuthorizeNetURL.  When I double click the Sub. function in Script Maker it writes out the syntax for me, which matches what you show.  ( ie. Substitute ( text ; searchString ; replaceString ) ).  I replace text here with Invoices::AuthorizeNetURL and I end up with:

Substitute (Invoices::AuthorizeNetURL; #; %23)

When I click OK, though, I get the following message:

The specified table cannot be found.

What's going on here!?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Author Comment

by:Andrew Angell
ID: 16794326
Ok, I was missing the quotes around the strings to replace, that was the problem there.  I'm still having issues, though...it simply didn't change the outcome.  Here's a screen shot of the way I have the filemaker script setup now...

http://www.dealsdirectinc.com/temp/script.jpg

So, it's suppose to set the AuthorizeNetURL field to the URL that is to get sent to my script based on data in FM.  This works great.  Right after that it's suppose to replace any # signs with %23 so that it's correctly URL encoded when sent to the browser.  Then, it uses Open URL to open the URL using the value of AuthorizeNetURL.

What happens when I run this is exactly the same as before I added the Substitute thing...it sends the URL with a # sign so when the browser hits that it sees an anchor and stops.  So it seems that my Substitute thing isn't working.  When I look in the browser address bar it's still got a # instead of %23.
0
 
LVL 28

Accepted Solution

by:
lesouef earned 1000 total points
ID: 16794475
on the 2rd set field line, set field (subst...) the field name is missing, so it applies to the current field, but none is active as there is no "goto field" before.
so just specify the field name there.
btw, you can combine the 2 Set field (invoices::authorizeneturl ) together:
set field (invoices::authorizeneturl ; substitute ("https://deal......." ; "#" ; "%23" ))
0
 
LVL 11

Author Comment

by:Andrew Angell
ID: 16794563
THANKS!!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question