Jump to content

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

Recommended Posts

  • Newbies
Posted

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!

Posted

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

  • Newbies
Posted

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!

Posted

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

  • Newbies
Posted

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

Posted

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

  • Newbies
Posted (edited)

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
Posted

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

This topic is 7100 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.