Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Get records from a fm-database to a website

Featured Replies

  • Newbies

Hey everyone,

I'm a new member here, and I'm from Belgium, so sorry for the spelling-errors!

I am a student, and would like to make dynamic webpages using html, php and filemaker!

I have a hosting, on an Apple Xserve, with filemaker server installed, and I use filemaker pro 7...

I already made a webpage, www.deform.be, with a contact-form, and this information is send to a filemaker database.

But now I want to make a 'comments'-page (some kind of guestbook) , and then I need something like this:

-You fill in a form on my site

-The fields are sent to an fm-database (so far, so good)

-Then you get redirected to de start-site of the guestbook

-And your comment is already there

So what I need to know now is how I can read out fields of a layout in my filemaker database, to a website, using nothing but php!

I would like to do it with only php (and html of course), not with cafephp of so...

I hope you understand my question, and already thx a lot!

Greetz from Belgium!

One way to achieve this is to use FM Server Advanced, which gives you an HTTP gateway. However, the price is very high, so another method is needed.

Using AppleScript as the "Connection" with PHP may have some potential. ODBC is another method to investigate.

Good Luck.

Garry

  • Author
  • Newbies

Hi Garry,

Thanks for your answer!

But on the server is FM server!

But isn't there a way to read the fields out of de FM database with juist the php code? If writing is so simple, reading must also be possible!

Unless you have FM Server Advanced, both Writing and Reading access, directly by PHP, would not be possible (that I know of). Unless, you can emulate the Instant Web Publishing (IWP) GET/POST commands.

That is why you may need to use AppleScript or ODBC to talk with PHP for access.

All the best.

Garry

  • Author
  • Newbies

But I have read and write access...

It is my own .fp7 file, on a server running fm server advanced!

I can read, write and delete as I please...

I just nead the php-code to read the data in de fm-database...

Here is a typical URL to access data from FM Server Advanced:

http://server.company.com/fmi/xml/fmresultset.xml?-db=products&-lay=sales&-findall

It will return the result as XML data. Hence, you will need to handle that with PHP. Here is a PHP function for getting data:

$mydata = file_get_contents( the url );

echo $mydata

To write to the database you would use the "-new" or "-edit" actions in the URL.

The Guide for this is, "fmsa7_custom_web_guide.pdf". You may be able to find it on the FM web-site.

Good Luck.

Garry

  • Author
  • Newbies

Ok so I have to acces my database with


$FM = new FM_and_PHP();

$FM->setFileMakerHost(");

$FM->setDatabaseName("");

$FM->setDatabaseUserPassword("");

$FM->setCommand("");

and then I have to set your code, for example:

$last_name = file_get_contents( the url );

echo $last_name

Edited by Guest

No need for anything other than the URL. Unless you need a login, then it could be something like this:

<?php

$thedata = file_get_contents("http://username:password@localhost/fmi/xml/fmresultset.xml?-db=products&-lay=sales&-findall");

echo $thedata;

?>

Garry

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.