1 of 1 people found this helpful
The PHP in lines 1-18 of your file don't appear to follow standard code from the PHP API.
For example, AFAIK there is no function called fmsTrapError() in the API.
Upon further investigation, it appears this form was created with FMStudio. As far as I know that was using fx.php and not the standard filemaker API. FMStudio is also DOA, with no known updates since version 12.
What broke it? unknown... probably you are missing references to some files that FMStudio generated or was using. Or something in there is no longer compatible with an update.
How to fix it? I would suggest rewriting it using the current API standards and files.
Oh, sure enough! It does indeed appear that the previous developer used FMStudio.
Yes, I agree that recoding might be in order here.
Where can I find information about API versions and what FMP versions they're compatible with? Our system is currently using v12 but we may soon be upgrading to v15.
1 of 1 people found this helpful
You should be using the PHP API files that come inside of the installer folder with your version of FileMaker server.
Usually they are installed to program files (or library on mac) /FileMaker Server/Web Publishing/FM_API_for_PHP_standalone.zip on the server.
You are looking for a file called “FileMaker.php”, and a folder called “FileMaker”
Copy the file and folder to your website directory.
To your PHP code, and you’re ready to start using the PHP API.
A good intro article, maybe a little old but still useful, is:
it covers establishing a connection to a database and reading out basic found sets.
Thank you so much, you've been ever so helpful!!
I have another question:
The FMStudio code has a function "fmsLiveInputField()" that updates between the web form and the database instantaneously. (I assume 'fms' stands for FMStudio.) This is the function that isn't working correctly in the current application.
Is there some analogous dynamic field functionality in the regular PHP API (the non-FMStudio version)?
Any tips on the best way to implement dynamic field functionality would be very appreciated!
The PHP/XML API is transactional, so that is correct, nothing updates in realtime like the behavior you see in filemaker itself. Rather, data is "posted" to a form that saves your changes or additions (or deletions) at the time of request.
If you do want to pursue it though, I would go through this intro so you understand the concepts:
From there, you will most likely need to switch to the XML API instead of PHP to make it easier to interface with Filemaker. Then I would start with a simple one-field form page and get the request/response updating. Once that's working you can implement it in your form wherever needed with copying and pasting.
Remember FMStudio used FX.php, and not the filemaker PHP/XML API, so it has slightly different capabilities and code. You'll need to rebuild that functionality if you want to use it with the current API.
In addition to MBs advice, I will add:
If you are looking for something like conditional (cascading) value lists with CWP and your lists are not excessively long, so can store the values in JS arrays. Call them ONCE to store as static text and use as includes for the JS to process. This can be very fast, not need the AJAX and not take trips to & from DB.
Many dependencies, but may be an option for even single (non-cascading) value lists.
Sent from miPhone