コード例 #1
0
<?php

// '<?' or '<?php' tells PHP to start parsing
/*********************************************************************
 * The comments herein are designed to be helpful to someone with    *
 * little or no programming experience.  To that end, many of the    *
 * comments may address things will appear obvious to many coders.   *
 * For the most part I'll place my comments at the end of each line. *
 * Feel free to e-mail any comments or questions to FX@iviking.org.  *
 * Please remember that this code is being released as open source   *
 * under The Artistic License of PERL fame...                        *
 * http://www.opensource.org/licenses/artistic-license.html          *
 *...and is also covered by the FX.php license addendum...           *
 * http://www.iviking.org/downloads/ADDENDUM.txt                     *
 *********************************************************************/
include_once $_SERVER['DOCUMENT_ROOT'] . "/FX/FX.php";
// FX.php contains the class for pulling data
// from FileMaker into PHP -- 'include_once()'
// makes sure the class is only declared once.
include_once $_SERVER['DOCUMENT_ROOT'] . "/FX/server_data.php";
// To make sure that these examples work for you, be sure
// to set the IP address of your server in server_data.php
// IMPORTANT: The leading '$' denotes a variable in PHP
$DatasetQuery = new FX($serverIP, $webCompanionPort, $dataSourceType);
// This line creates an instance of the FX class
$DatasetQuery->SetDBUserPass($webUN, $webPW);
$DatasetQuery->SetDBData('Tester', 'Main_View');
$LayoutData = $DatasetQuery->FMView();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
コード例 #2
0
ファイル: fx_tester.php プロジェクト: SmartPCGuy/fxphp
    // set database and layout information
    $contactsListQuery->SetDBData('Contacts.fp7', 'web_list');
    // set database username and password
    $contactsListQuery->SetDBUserPass($webUN, $webPW);
    // add parameter array for new record
    $contactsListQuery->AddDBParamArray($searchRecordsArray);
    // create a new record
    $contactsList = $contactsListQuery->DoFXAction('perform_find');
} else {
    // otherwise, find all records
    // configure a connection to FileMaker Server Advanced
    $contactsListQuery = new FX($serverIP, $webCompanionPort, $dataSourceType);
    // set database and layout information
    $contactsListQuery->SetDBData('Contacts.fp7', 'web_list', 'all');
    // set database username and password
    $contactsListQuery->SetDBUserPass($webUN, $webPW);
    // retrieve all records in this database available to the current user
    $contactsList = $contactsListQuery->DoFXAction('show_all');
}
?>
<html>
    <head>
        <title>FX Error Tester</title>
    </head>
    <body>
        <h1>Contact List</h1>
        <table border="1">
            <tr>
                <th>First Name</th>
                <th>Last Name</th>
                <th>Phone Number</th>