10 Replies Latest reply on Jun 29, 2017 7:06 AM by beverly

    Is CWP with PHP the correct option

    ndveitch

      Hi All,

       

      I have a big question to ask, we are busy adding to a current solution and need to start web integration. Our web hosting company has put a page together for us where our suppliers will log on and upload invoices. The idea we have is that the web developer has put the site together using a MySQL DB and using PHP, so my thought is to use the FM PHP API to communicate between the FM DB and the web site.

       

      The idea we have is that the suppliers will log onto the website, upload their invoices and complete required fields. Then the stand alone suppliers DB we have created will then poll the website DB and when a supplier has uploaded their information, we would then pull that down to our system and the various departments can then log into the suppliers DB to do all their admin checks. Should there be any issues with the invoice, they can make a comment for the supplier which will then be pushed back to the website and the supplier can then view the comment and take any appropriate actions. Or if the invoice is ok, the department can mark it ready for payment and that notification will be sent back to the website so that supplier can see that their invoice is in the process of being paid. Once the invoice has been marked for payment, finance will pull the invoice into the main system and then the normal processing of the invoice will take place. Last thing is, when the invoice is paid, the suppliers db will be updated with status PAID and this will then be pushed to the website.

       

      Now the main issue is we have no web dev skills at the moment and coming up to speed with it is taking a bit longer than I thought. We have our test DB open on our FMS15 server with the PHP extended privilege set, I used the MAMP setup that I found on the Blue Feather website, Introduction to FileMaker Custom Web Publishing (CWP) with PHP | Blue Feather - FileMaker Developer, Android, Web , and internally on the network we have been able to get communication between my local machine and the DB hosted on the FMS15 but now i am out of the office and I can't seem to access the DB. I updated the IP to the external ip, $fm = new FileMaker("Suppliers", "xxx.xxx.xxx.xxx", "PHP User", "xxxxx"); but I get this error, Communication Error: (22) The requested URL returned error: 503 Service Unavailable - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user. The only thing I changed was the IP address, so I know the details are correct.

       

      If my understanding of FM PHP API is correct, once we can get this working, then we just need to send the php files to the web developer and he can add it to his side and we should be 50% of the way to the solution we have in mind.

       

      Also do I have to open ports 8998 on the server firewall?

       

      Seeing as we are still learning web dev skills, should we go the PHP route, or should we rather investigate JSON or REST? Or am I getting the technologies confused?

        • 1. Re: Is CWP with PHP the correct option
          Johan Hedman

          I would recommend you to use Goya´s FM RestFM (RESTfm | FileMaker RESTful Web Service ) instead of FM PHP and create your own API.

           

          With RestFM you can just create scripts in FileMaker that the users you ask for information. You can easily setup all different kind of request that you need, each one with a unique script with a couple of parameter to make sure they enter there information.

           

          We have used this technique successfully in several projects where there is a need to communicate with other APIs, both to and from FileMaker. 

          1 of 1 people found this helpful
          • 2. Re: Is CWP with PHP the correct option
            ndveitch

            I was thinking about going the RestFM route as I see that is the new addition to FM16 and hopefully by the time this is live my client will be ready to go to FM16.

            • 3. Re: Is CWP with PHP the correct option
              Johan Hedman

              At the moment FileMakers own API can not handle scripts, but hopefully there will be there in the future. Until then in my point of view Goya´s RestFM is the way to setup a API from FileMaker.

              1 of 1 people found this helpful
              • 4. Re: Is CWP with PHP the correct option
                user4078

                You want to transfer data from MySQL (hosted externally) to your local FM DB.  This can be done via ODBC if your hosting company allows this.

                There is ESS (External SQL Sources) which allows SQL Tables to be integrated into FileMakers relationship graph and ODBC-write via script step Execute_SQL and ODBC-read via Import_records.

                1 of 1 people found this helpful
                • 5. Re: Is CWP with PHP the correct option
                  ndveitch

                  Would I set the ODBC up on the FM Server itself? The reason I ask this is because we are developing on Mac and we only have the SQL Actual ODBC driver and I would need to get the MySQL ODBC driver to get it to work on my Mac. Yet my client is fully Windows and I see that the MySQL ODBC comes with Windows by default.

                  • 6. Re: Is CWP with PHP the correct option
                    user4078

                    In case of ESS the ODBC driver needs to be installed on FM server.

                    Scripted ODBC transfer can also be handled by the client (your local FM session).

                    1 of 1 people found this helpful
                    • 7. Re: Is CWP with PHP the correct option
                      beverly

                      While a good suggestion otherwise, the Hosting where PHP/MySQL is being used, REST (fm) may not be in their wheelhouse. It would definitely be worth an ask.

                       

                      Sent from miPhone

                      2 of 2 people found this helpful
                      • 8. Re: Is CWP with PHP the correct option
                        wimdecorte

                        ndveitch wrote:

                         

                        I was thinking about going the RestFM route as I see that is the new addition to FM16 and hopefully by the time this is live my client will be ready to go to FM16.

                         

                        Be careful here...

                         

                        RESTfm is a product by Goya, that's different than the new REST DATA API that FMI introduced with FM16.  The new Data API is great and fast but lacks some fundamental functionality, mainly the ability to run scripts.  That may or may not be a deal breaker.

                         

                        The other thing to keep in mind with the native Data API is that it is in beta.  It is a given that some of its calls will change by the time the official product is released.  Also the licensing is unknown.  So you can't determine what your eventual cost will be.

                        1 of 1 people found this helpful
                        • 9. Re: Is CWP with PHP the correct option
                          wimdecorte

                          ndveitch wrote:

                           

                           

                          Seeing as we are still learning web dev skills, should we go the PHP route, or should we rather investigate JSON or REST? Or am I getting the technologies confused?

                           

                          You are getting technologies confused to some extent.  There's two choices to make:

                          - the underlying FMS API to use, that is the mechanism for the data transport and how to construct the calls

                          1) XML (used by the PHP API)

                          2) REST/JSON

                          3) ODBC/JDBC

                           

                          and secondly:

                          - what server-side scripting technology to use: PHP, Ruby, Python, C#,...

                          This is an important choice because it does tie you to a certain technology and switching between them is not easy; they each have a very real learning curve.  So strategically decide what technology you want to invest in.  Each of these choices can use any of the 3 data mechanism so the choices are not closely tied.

                          3 of 3 people found this helpful
                          • 10. Re: Is CWP with PHP the correct option
                            beverly

                            Start here:

                            ODBC Overview

                            Exchange data with open ODBC standards

                            FileMaker Software Deployment, Business Software Solution - FileMaker

                            There are several ways to use ODBC/JDBC (push/pull) working from either FMS or your existing hosted DB.

                            This may be easier to connect FileMaker to MySQL (with permissions!) rather than having to write PHP page for the exchange. If you cannot have access otherwise, PHP can be used.

                             

                            See Wim's reply, too!

                            Beverly

                            2 of 2 people found this helpful