September 6, 201213 yr Hey all, I have been tasked with a little bit of a problem. PHP is not my primary language, so I'm getting up to speed, and I know little of FileMaker. I understand I need the FileMaker.php and related folder containing the API. I have verified the permissions on Filemaker. i.e. Extended privileges, FMPHP assigned, etc. I have db name, username, password, db server I wanted a simple script that tells me yes/no I am connected to a database. Something like: 1. setup connection (with FileMaker.php require once) 2. Echo yes/no, I am connected to the database, show error info if "no" I searched the forums, and google and have not found something that works in the context of one simple file. I think once I can confirm I can/cannot connect I can begin troubleshooting permissions, etc. Thanks so much in advance for your help! DM
September 6, 201213 yr try: <?php error_reporting(E_ALL &~E_DEPRECATED); include('filemaker/FileMaker.php');//edit to show correct path to FileMaker.php $fm=new FileMaker('yourDB', 'yourURL', 'yourUsername', 'yourPassword'); $connection = $fm->listLayouts(); if(FileMaker::isError($connection)){ echo 'Database Error: ' . $connection->getMessage(); } else { echo 'Connection established'; } ?>
September 6, 201213 yr Your in luck - what you are asking for comes with FileMaker Server. Open your server page in a web browser and review the links at the bottom http://localhost:16000 (use that link from the filemaker server, otherwise replace localhost with your servers ip/domain)
Create an account or sign in to comment