Jump 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.

Featured Replies

I have been doing some testing with FM and PHP. The PHP is standard on an OS X Server. I have been able to find data and edit records from a FM database using the PHP 'readfile()' function. Like this:

<?php

readfile ("http://10.0.1.2:1154/FMPro?-db=combotest.fp5&-lay=web&-format=hworld.html&name=bloggs&-recid=1&-edit");

?>


Hope this is of interest.

Garry

I have seen others refer to working with .php and FMP. FMP has made it quite clear they are XML ready. Do you also write xml? (Here I'm looking for comparative information as to usefulness.)

If you don't write xml, why did you gravitate to .php? Just curious.

  • Author

Good questions.

I have been using PHP recently to talk to a mySQL database. A job I am working on required 'Open Source'. Both of these are available as 'Open Source' and come with OS X Server. Also, mySQL and PHP hosting are easy to come-by and less expensive than FM hosting.

Another job I am working with is an XML Registry, whilst I am not an XML expert (yet!), I think Java will be the middleware. This is so different database types can be used (FM included).

I have a couple of aims for using PHP with FM/CDML. One is for security reasons, all access to the FM db can be through PHP with no direct access available. The other reason is for interoperability and integration of different data-sources.

I don't intend to use ODBC for the connections. It will all be PHP/CDML, which has been very fast so far.

I used a similar system with Flash and FM/CDML over a year ago. This worked very well. It was for games, so that the players could keep highest scores etc, and that data would be integrated with a much larger database system.

FM/CDML is easy to work with and is my preference. However, being able to use FM/CDML with PHP opens up more opportunities.

All the best.

Garry

Thank you for the informative response.

Thank you!

I wish I had more time frown.gif

Or the day last 30 hours smile.gif

Garry, you wrote in response to my earlier inquiry, "I have a couple of aims for using PHP with FM/CDML. One is for security reasons, all access to the FM db can be through PHP with no direct access available. The other reason is for interoperability and integration of different data-sources.".

Does xml allow direct access to FMP? Are the security issues with xml the same as with Web Security, greater or lesser?

Would it be possible to integrate php with xml to take advantage of security, or to increase security?

I'm curious. I've this past week started to read a text on xml (only 800 pages to go) and I have yet to get into php.

  • Author

Keith,

Extracting XML from FM offers exactly the same security challenges. A typical URL would look like this:

http://localhost/FMPro?-db=pages.fp5&-lay=web&-format=-fmp_xml&-findall

I haven't used PHP with XML yet. However, using the 'readfile()' and 'file_get_contents()' (in current beta vers of PHP) functions, you can 'hide' the database from the outside world. It could be on another computer on your LAN, or you can embed a 'userid' and 'password' into the PHP code which constructs the URL.

All the best.

Garry

Thanks Garry, I'll keep this thread in mind as I proceed. I really appreciate your input.

Garry Is The Man!

  • Author

Thank you wink.gif

I will keep reporting on how I go with integrating PHP and CDML.

I'm going on holidays for a week in North Queensland; so I will be absent for a little while. cool.gif

All the best.

Garry

Have a great holiday.

All the best.

I am going to fight the boys from FileMaker Inc. in Desert Springs ???-)

  • 2 months later...

so... have you investigated this further? Any chance of an update? I currently have PHP - Filemaker communicating through ODBC but it seems rather slow. I'd appreciate any hints at alternative methods using PHP & Filemaker.

VS

  • Author

I have been able to insert data into a PHP page like this:

<html>

<head>

<title>fm2php.php</title>

<meta name="generator" content="BBEdit 6.5.3">

</head>

<body><table>

<?php

$myData = file ("http://10.0.1.2:1154/FMPro?-db=combotest.fp5&-lay=web&-format=fm2php.txt&-findall");

while (list ($line_num,$line) = each ($myData)) {

echo "<tr><td>", trim (htmlspecialchars ($line)), "</td></tr>";

}

?>

</table></body>

</html>


Here is the Format file, fm2php.txt:
[FMP-Record][FMP-Field:name,raw]

[/FMP-Record]


I have not tested this with large files. However, the speed with small files is fast.

All the best.

Garry

Hello

I'v been using php/xml/filemaker for the last month and it works pretty well.

Thanks to www.iviking.org

you can see it at work (in french) at www.fmqc.ca/fr/succes.php

The system works in combination with the xml output from the web compagnion and it

is as fast as the regular cdml system.

Hope it helps.

Create an account or sign in to comment

Important Information

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

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.