コード例 #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
$DatabaseData = $DatasetQuery->FMDBNames();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <title>iViking FX -- Database List Dataset Example Page</title>
コード例 #2
0
ファイル: index.php プロジェクト: SmartPCGuy/fxphp
    $FXE_groupSize = 2;
}
if (!isset($FXE_action) || strlen(trim($FXE_action)) == 0) {
    $FXE_action = 'display';
}
if (!isset($FXE_username) || strlen(trim($FXE_username)) == 0) {
    $FXE_username = '';
}
if (!isset($FXE_password) || strlen(trim($FXE_password)) == 0) {
    $FXE_password = '';
}
if (fopen("http://{$FXE_FMServerIP}:{$FXE_FMWCPort}/", 'r')) {
    $errorMessage = 'No valid Database specified.';
    $FXQuery = new FX($FXE_FMServerIP, $FXE_FMWCPort, $dataSourceType);
    // This line creates an instance of the FX class.
    $DatabaseData = $FXQuery->FMDBNames();
    // The '->' indicates that SetDBData is part of
    // the FX instance we just created.
    if (FX::isError($DatabaseData)) {
        echo "<pre>\n";
        print_r($LayoutData);
        echo "</pre>\n";
        exit;
    }
    foreach ($DatabaseData['data'] as $key => $value) {
        $currentDatabaseList[] = $value['DATABASE_NAME'][0];
    }
    unset($DatabaseData);
    if (in_array($FXE_currentDatabaseName, $currentDatabaseList)) {
        $FXQuery->SetDBData($FXE_currentDatabaseName);
        $FXQuery->SetDBPassword($FXE_password, $FXE_username);