Jump to content
charmcello

FMP PHP API: dropdowns and radio buttons missing

Recommended Posts

I am tasked with troubleshooting a web registration form that queries a Filemaker Pro v12 database via a Filemaker PHP API.

The web form had been running well for a couple of months after major revision, when all of a sudden:

  1. All dropdowns are empty
  2. All radio buttons are missing
  3. These symptoms appear to be browser-independent.

The appearance of these symptoms is mysterious:

  1. Nobody has modified the PHP code for the web form - I've done a compare with a backup done at the time when the web form was not broken and it is identical to what is currently on the server. 
  2. The Filemaker Pro layout that the web form is querying is just fine - all the value lists for the dropdowns and radio buttons are present.

I've created a stripped-down version of the web form: https://campmeetings.cccsda.org/test_form.php and I've also attached the php source code file.

The date and record fields are populating correctly. Notice the empty dropdown list after "Church I attend."

Could this be caused by an incompatibility between the FMP PHP API and PHP libraries on the server? Perhaps due to a PHP update on the server? Any ideas how to troubleshoot this? 

test_form.php

Share this post


Link to post
Share on other sites

I wil note that this is not done purely with the API - it's an FMStudio v2 generated page which uses some custom functions not used in the API.

And that FMStudio went unsupported a few years back.

It's also not a query page - it creates a new record, and reads data back from that record.

That said, if the WebForm layout does have the value lists available when a brand new record is created (used for drop downs and buttons), this looks like it should work

Edited by webko

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Similar Content

    • By jayivan
      I am working on an API integration from FileMaker 17 to Emma. Generally when I work on a new API, I get the curl working on the command line and then translate that into FM. But I've hit a roadblock with one particular API call while my other API calls to Emma are successful. (In the example below, I substituted out sensitive data with all caps.)
      From the command line, the code is:
      curl -u USER:PASS -H "Accept:application/json" -H "Content-type: application/json" -X POST -d '{"fields": {"name_first": "TESTFIRST","name_last": "TESTLAST","eligible": "false","expiration": "@D:2019-06-30"},"group_ids": ["GROUPIDNUMBER"],"email": "EMAIL@EMAIL.COM","opt_in_confirmation": "false"}' "https://api.e2ma.net/ACCOUNTNUMBER/members/signup"
      This command is successful.  The server responds with the individuals' emma id and group confirmation. 
      This fails using Insert from URL within FM though. While eventually I'll use FileMaker fields for an individual record's names, email, and expiration dates, I did not use fields in my testing in order to duplicate the command line exactly. In Insert from URL:
      The URL is "https://api.e2ma.net/ACCOUNTNUMBER/members/signup"
      The curl option is "-u USER:PASS -H \"Accept:application/json\" -H \"Content-type: application/json\" -X POST -d '{\"fields\": {\"name_first\": \"TESTFIRST\",\"name_last\": \"TESTLAST\",\"eligible\": \"false\",\"expiration\": \"@D:2101-06-30\"},\"group_ids\": [\"GROUPIDNUMBER\"],\"email\": \"EMAIL@EMAIL.COM\",\"opt_in_confirmation\": \"false\"}'"
       
      Can anyone identify the problem or suggest a workaround? My experience with API integration with FM is limited, but anything I could get working via the command line, I've been able to get working within FM until this.
    • By Richard Carlton
      In this Coaches' Corner tip, Richard Carlton challenges you to go learn how to use RESTful services!
      Get up to speed with the FileMaker Pro 16 Video Training Course! 
      Top Rated Course by FileMaker Expert, Richard Carlton.  
      http://learningfilemaker.com/fmpro16.php
      Experience Richard's dynamic and exciting teaching format, while learning both basic, intermediate, and advanced FileMaker development skills. With 27 years of FileMaker experience and a long time speaker at FileMaker's Developer Conference, Richard will teach you all the ins and outs of building FileMaker Solutions.  The course is 50 hours of video content!
      Richard has been involved with the FileMaker platform since 1990 and has grown RCC into one of the largest top tier FileMaker consultancies worldwide. 
      Richard works closely with RCC's staff: a team of 28 FileMaker 
      developers and supporting web designers. He has offices in California, Nevada, and Texas.

      Richard has been a frequent speaker at the FileMaker Developers Conference on a variety of topics involving 
      FileMaker for Startups and Entrepreneurs, and client server integration.

      Richard is the Product Manager for FM Starting Point, the popular and most downloaded free FileMaker CRM Starter Solution.

      Richard won 2015 Excellence Award from FileMaker Inc (Apple Inc) for outstanding video and product creation, leading to business development.

      RCC and LearningFileMaker.com are headquartered in Santa Clara, CA.

      http://www.rcconsulting.com/
      Please feel free to contact us at support@rcconsulting.com
      If you want to explore building iOS apps for iPhone or iPad and deploying those out to the Apple App Store.
       
      Here is a video introduction to our iOS App Training https://www.youtube.com/watch?v=cVxQe_yAshw
      Looking for FM Starting Point free software download: http://www.fmstartingpoint.com
      For More Free FileMaker Videos Check out http://www.filemakerfree.com
      Visit http://www.learningfilemaker.com for all facets of FileMaker Award Winning Video Training.
      Please Visit Our Channel: https://www.youtube.com/user/FileMakerVideos Please Subscribe While There.

      Please Comment, Like & Share All of Our Videos.

      Feel Free to Embed any of Our Videos on Your Blog or Website.
      Follow Us on Your Favorite Social Media
      https://www.facebook.com/FileMakerVideos
      https://twitter.com/filemakervideos
      https://plus.google.com/+FileMakerVideos/videos

      Filemaker Pro 16 Training Videos
      FileMaker 16 Videos
      Filemaker Pro 16 Video Course
      #FileMakerVideos
      #FileMakerTrainingVideos
      #WhatisFilemaker16
      #FilemakerPro16Training
      #Filemaker16VideoTutorial
      #FilemakerPro16Videos
    • By docasar
      Hello,
       
      I am trying to connect to our current database with our shipping company so I can update the status of the delivered orders. To do that, I am currently using insert from URL and then parse the code to extract the info I need. However, I believe there should be a cleaner and safer way to do it using webservice.
      So I downloaded the documentation and looks very straightforward to set and I have been able to set up the POST and send it getting the data as XML using POSTMAN (as very well explained here:  http://www.filemakerprogurus.com/filemaker-api-integration-salvatore-coleangelo/ ) and also in the great post by luminfire https://luminfire.com/2017/06/12/curling-filemaker-16/.
      However, when I try the same parameters on my script in filemaker, I get all the time an error saying that something like  "Entry XML Schema/template it is not loaded correctly". Following the documentation of the API I see that on Postman I need to insert on the Body RAW some kind of code that looks like this: 
      <?xml version='1.0' encoding='UTF-8'?>
      <SeguimientoEnviosRequest xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='SeguimientoEnviosRequest.xsd'>
      <Solicitante>x</Solicitante><Dato>xxxxxxxxxxxxxxxxx</Dato>
      </SeguimientoEnviosRequest>
      but I don't know which settings I have to do on my script to make the call work.
      Any suggestions as to where to put this info so the can be passed with the CURL? I am a bit desperate now because I see the amazing possibilities that the interaction with the web service may bring but I can find a way to make it work...
      Thanks a lot for your always invaluable support!!
    • By jpons
      Hi,
      I want to enable the Cloud REST API, but I am afraid that I "dismissed" the notification message that allowed me to do so. How can I enable the RESP API on my cloud instance?
      Thanks,
      -J
    • By jstewart30
      Running FMS 13 and trying to run a simple PHP page from my website to access a database, but I'm only getting a blank page.  Not sure if it's a port forwarding issue or a PHP issue, or something else.  If I put my .php file and the includes ("FileMaker.php" file and "FileMaker" folder from the FMS PHP .zip file) in the fmi-test folder on my FM server and access it locally (http://localhost/fmi-test/myphpfile.php), the PHP file works fine and returns data, so I don't think it has any inherent issues, and presumably my FMS is set up correctly.  Putting the same .php file and includes on my web server, though, results in a blank page only.  The includes are in the same directory as the php file itself.  Here's the php file (I've changed the IP address and database names to protect the innocent but they're correct):
       
      <?php
      error_reporting(E_ALL);
      ini_set('display_errors', 1);
      include_once('FileMaker.php');  /* have also used require, include, and require_once with no change */

      $fm = new FileMaker("MyDatabase", "http://myfilemakerserver:8888", "Admin", "");   /*no password*/
      $findCommand = $fm->newFindCommand("MyDatabase");
      $findCommand->addFindCriterion("Phone", "303-555-1234");
      $findCommand->setRange(0, 1);
      $result = $findCommand->execute();
      if (FileMaker::isError($result)) {
          echo($result->getMessage());
          return;
      }
      $record = $result->getFirstRecord();
      $name = $record->getField("Customer Name");
      $status = $record->getField("Status");
      echo("$name - $status");
      ?>
      Infuriatingly I get no errors or feedback, just a blank page when I run this file from my website (but again it works fine locally on the FM server machine). I've confirmed PHP is working on my website as I can do a simple phpinfo() file in the same directory and it runs fine and displays the PHP info.  If I direct a web browser to the same "http://myfilemakerserver:8888" (not the real address obviously, but it is port 8888) I get the "Filemaker Database Server Website" page, so the port forwarding seems to be correct.  I have port 8888 forwarding to port 80 of my FM Server.  I don't have port 443 forwarded to that machine as that's being used for another device on our network, but I assume if I'm not making "https" requests that it should work fine (but maybe that's my problem?).  
      I assume it's just something simple but I've been beating my head against a wall for the better part of the day on this.  Any help would be greatly appreciated.
  • Who Viewed the Topic

    2 members have viewed this topic:
    DR. ALI BAHAR  SarahS 
×

Important Information

By using this site, you agree to our Terms of Use.