Comunicating with FM via a web application


We are developing a web application with PHP for a client. This web application needs to access Filemaker databases, which are located on a pc at the client's premises (connected to the Internet).

What I need to know is, is it possible to access the Filemaker database from the Web application?
I have heard of using ODBC drivers to communicate with Filemaker but am unsure wheather this communication can be done from the web application (using php and ODBC) and the client's PC over the Internet.

Just wanting to confirm if this is possible or if there is a better way of doing this? Explanations or link to resources would be helpful.

We are planning on upgrading the current Filemaker 3 to a later version too, possibly v7 or server.
I thank you

Who is Participating?
Conclusions (assuming the database is publishing to a single web site.)

If you want minimum effort, and the traffic is not too heavy, go with FM7 client and the ODBC driver.

If the database needs to handle tons of traffic, then FM 7 Server Advanced is probably the best solution.

If you want maximum flexibility, go with the XML approach and a FileMaker 6 client.

Or, you could always consider a THIRD option:
Use FileMaker itself as the basis for your application instead of PHP. Before version 7, FileMaker used its own markup language called CDML, to generate custom web sites. CDML is similar to PHP or ASP, but specific to FileMaker, with its own syntax. With Version 7, FileMaker uses an XML-based markup language. Both are pretty powerful.

Lasso is a popular extension to FileMaker that allows more powerful and flexible web publishing than FileMaker's built-in web server.

More resources...

Once you know how ODBC works in general, there's not a lot of need for extensive tutorials. The FM ODBC driver works pretty much like any other. You create a DSN based on the FileMaker ODBC driver, and you can then connect to it from other computers, including over TCP/IP.

Here's a brief intro to ODBC by the company who made the FM 7 ODBC drivers.

Here's a reference on using ODBC with PHP
XML References:
Here's a page that describes using PHP in conjunction with FileMaker's XML capabilities.

There's an open source project called FX.PHP which you may want to take a look at. This is basically a set of PHP classes specifically designed to talk to a FileMaker database through the web publishing interface.

Another similar project is called FM-and-PHP (not a very imaginative name.) I have heard many good things about this package, but the last time I looked at it, the documentation was only available in German, which kept me from pursuing it further. I believe they now have English documentation available.[v][title]=about_fmandphp

Can you provide a bit more detail on the nature of the database and your application?
Well, there's certainly a lot for you to think about with this project. I'm splitting my response into separate messages because it's so long.

First, a little background info...
Version 4 was the first with the built-in web publishing feature. It uses the same file format as version 3.

The first version with an odbc driver was version 5, which introduced the FP5 file format. Version 5.5 added XML support and some more new features, and version 6 added a few more, but these were not major revisions, more like updates. All three share the same file format, and all provide a decent built-in web publishing platform, but with some limitations. Unfortunately, the odbc drivers are lame.

FileMaker 7 is the most powerful version ever. It provides virtually unlimited storage capacity in fields, lots of enhancements in terms of scripting and calculations, vastly improved ODBC drivers, and perhaps most important, it allows multiple tables in a single dataabase file. However it also has the biggest learning curve, the highest pricetag, and puts some new restrictions on the client/server environment.

You'll definitely want to do that upgrade sooner rather than later. FileMaker 3 doesn't really have the connectivity options you need, and is quite old now. In fact, it's not even mentioned on the FileMaker web site at all, let alone supported.
Which version should you upgrade to? That depends on several factors.
How complicated is the application?
How much time and money do you have to spend?
What kind of traffic is expected?

Basically, you have two possible ways to get data out of FileMaker dynamically. You can use ODBC to query the FileMaker database, or you can use FileMaker's built-in web publishing capabilities as an XML interface. Both require you upgrade your current version.

The biggest advantage of the ODBC approach is it's easy. ODBC is widely used, and PHP has lots of ODBC-specific functions. If you mostly plan to make simple queries and display the results, ODBC makes sense. However there are limitations to what you can do via ODBC, especially with older versions of FileMaker. Also, the ODBC drivers before version 7 are slow. Long story short, if you want to use ODBC, then FileMaker 7 is DEFINITELY the way to go. The drivers are much faster and more powerful than those for previous versions.

The web/XML approach takes advantage of the fact that the output from FileMaker's web publishing feature can be captured and manipulated as XML using a language like PHP, Perl, etc. PHP is the most popular for this purpose. This method is more powerful and flexible than ODBC, and generally faster as well. But it also requires learning a lot more stuff, and is more complex to set up.
The FM5-6 family actually offer better web publishing through the client program than FM7 does.
Web Publishing with the FileMaker 7 client is still available, but in a crippled form, which limits its usefulness for your purpose. In order to use custom web publishing with FileMaker 7, you must buy the Server Advanced product, which is very expensive.

So if you want to try the XML approach, you will probably want to go with an FM5-6 client, or FM7 Server Advanced.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

S_K_YorkAuthor Commented:
Hi BillMercer
Thanks for your response.

The reason I asked the initial question was to find out if our web application can transfer information (from mysql database) over the Internet to the Filemaker database which is located at our clients premises (by using php/odbc or some other means). The point I'd like to emphaise is the "over the Internet" part.

After reading your response, I came to an agreement that version 3 didnt have the connectivity options we needed.

So what Filemaker version would solve the "over the Internet" part would you recommend, or what other technology/Filemaker features could be used to solve this "over the Internet" part?

I thank you
Points now 100

S_K_YorkAuthor Commented:
Sorry BillMercer

You posted your other response before I posted my reply to your first response
I just saw your response. I was typing at the same time you were...

Either ODBC or the XML approach will work over the internet. With ODBC, FM7 is your only real option, because the version 5 and 6 drivers allow select queries, but no update queries, which basically means they are read-only.

Setting up an ODBC connection basically involves creating a DSN on the database host, opening the database, then creating a connection string in PHP that points to the host. The PHP ODBC commands are similar to the MySQL commands (odbc_connect instead of mysql_connect, etc.) so it should be pretty straightforward if you've been working with mysql.

With the XML approach, you're probably better off going with FM6, simply because it's less expensive than getting FM Server Advanced. You can still get older versions of Filemaker from resellers, even though FM corp doesn't sell it anymore.

With FM6, you'd actually be using FileMaker's built-in web server to generate output that can be parsed by your program. You could even do this with libcurl or something, though you will probably want to look at the predefined FM classes I mentioned in my previous post.

It's late here, so I'm going to bed now, but I'll be back tomorrow.  

S_K_YorkAuthor Commented:
Hi BillMercer

Basically, the web application is for a screen printing company. Some of the business requirements involved are:

1. Viewing a products catalog
2. Display instant online quotes for screen printing jobs
3. Taking orders based on these quotes
4. Viewing the order status
5. creating customer accounts
6. Viewing previous jobs done in the past
7. Making payments online
8. Approve artwork for comencing job

The nature of the database:
The mysql database is used to hold catlogue information, confirmed quotes (orders) and other details.

Every morning, these orders, payments, order status, aproval artwork sheet information are tranfered to the Filemaker database for further processing at the clients premises

Most of this information for the business requirement can be located on the mysql server, so the web application can interact with mysql. Taking orders,payment and approval signoff sheets needs to be transfered back to Filemaker.

I have read the 2nd question first, this conversion took place while I was sleeping (European timing!).
A little add to what I wrote:
If the Fm app is to be kept without updating FM3, and a daily sync is enough, I would make an "export daily operations" in PHP to an ascii file which I would import in FM3.
If FM3 supports opening URL's (I don't remember for FM3, FM4 did), you could even trigger this php export function from within FM.
S_K_YorkAuthor Commented:
Thank you

I must compliment you with your answers. You have manage to answer my question and more

Thank you guys and much apreciated

It would be a bit more work to set up, but you could generate XML from the MySQL through PHP, then script an import into FileMaker from the XML source.

That way the FileMaker user could simply click a button and automatically download and import the most recent information.

it seems they really wanna keep fm3, and you need fm6 to do that (I don't remember what 5.0 was doing)
I think 5.5 can import XML as well.  5.0 doesn't.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.