Newbies iRuben Posted August 21, 2005 Newbies Posted August 21, 2005 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!
Garry Claridge Posted August 21, 2005 Posted August 21, 2005 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 iRuben Posted August 22, 2005 Author Newbies Posted August 22, 2005 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!
Garry Claridge Posted August 22, 2005 Posted August 22, 2005 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 iRuben Posted August 22, 2005 Author Newbies Posted August 22, 2005 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...
Garry Claridge Posted August 23, 2005 Posted August 23, 2005 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 iRuben Posted August 24, 2005 Author Newbies Posted August 24, 2005 (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 August 24, 2005 by Guest
Garry Claridge Posted August 24, 2005 Posted August 24, 2005 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now