When addressing integration challenges with FileMaker, we try to solve them using the SmartPill plug-in (www.scodigo.com), especially when we have already used it for other purposes within a given solution. I’d like to share a technique we use for managing PHP in SmartPill that we have found to be very helpful and powerful.
In order for FileMaker to execute PHP, the PHP has to exist somewhere. It can be hard-coded into a script or stored in a field or a variable — there are a variety of approaches. Within SmartPill are several FileMaker-centric functions that will help you take full advantage of its functionality. Perhaps most important of these is the function “fm_evaluate,” which allows a user to pass data from FileMaker’s calculation engine into a piece of PHP code.

The Colibri team has created a library of the PHP functions we typically use in a given solution. Normally, we have a record in a FileMaker table that has a text field containing the PHP code for a specific function. The variables declared at the head of the function contain the necessary fm_evaluate calls. Each record has a unique serial number and a global field that can be used as a self-join. We develop a script that feeds the specific value correlating to a specific PHP call so that the PHP code is available on a global basis to the solution and driven from the context in which it is invoked. Consequently, our library becomes a solution-specific subset of PHP.
We have used this functionality to:
- manage a digital archive;
- manipulate directories on local machines;
- use Web services via SOAP for credit card transactions; and
- create SQL queries on SQL databases that do not require ODBC connections.
SmartPill also has a PHP extension for FileMaker that allows you to do SQL queries directly against FileMaker, create global variables outside of FileMaker’s field structure, and launch scripts, as well as error trap.

We want to hear about your experiences using FileMaker, PHP and SmartPill. Please contact us or add any techniques, questions or comments to this blog.
J Sciarra
Chief Technologist
[...] public links >> filemaker One Approach to using FileMaker, PHP and Smart Pill Saved by raymondiwi on Sat 04-10-2008 My Free Mac Student Software Arsenal Saved by bentoi on Wed [...]