Jump to content

N00b sample PHP script request


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

Recommended Posts

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

Link to comment
Share on other sites

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

}

?>

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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