I’ll admit, pushing parameters to FileMaker WebDirect sessions has not been high on my priority list.
Actually, it hasn’t made the list at all, so far. Thankfully, guys like Mike Duncan, Mike Beargie, and Steve Senft-Herrera are on the case. FileMaker removed the ability to pass parameters to WebDirect in the 13.0v2 update, and these enterprising fellows found a way to add it back and keep it secure:
The solution (download available at the link below) includes setting up three php files and modifying some scripts, but is useful for those time when passing parameters is a must:
To be able to pass in parameters to a WebDirect session, we will utilize just a few external PHP. There are several ways to go about this, and differing approaches may suit your particular use case. For this example, we will highlight a more general approach that provides a great amount of flexibility. This script will also allow us to pass in as many parameters as you need to.
Here’s how it works, in only three steps:
- The initial page, “fm_link.php” will set all the passed parameters into a session variable.
- Next, a web viewer will set the session variable to a temp file on the server using the next PHP page, “fm_write.php” using a key assigned by FM, and destroy the session in PHP.
- Finally, an Insert from URL will access the temp file and convert the returned parameters as local variables in FM, then perform a find with some of the parameters that were passed.
With three fairly simple PHP scripts, we will store all parameters in the URL string as key-value pairs. An example of this might be:
This solution is for advanced developers or those with some php experience. But it’s also a great way for intermediate users to learn more about php and FileMaker.