Jump to content

This topic is 8137 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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.

Posted

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

Posted

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.

Posted

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

  • 2 months later...
Posted

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

Posted

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

This topic is 8137 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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