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.

N00b sample PHP script request

Featured Replies

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

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';

}

?>

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

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.